Hello
I need a little help with a SQL Server 2005 query I'm trying to do.
Basically I have a table that contains multiple columns, two of which are ARC_DOCMONTH and ARC_DOCYEAR that contain the current month and year respectively. The datatype of both is varchar.
I need to return all records that have the current month and year in those two columns. I thought I could do something like:
But I always get the error that Now() isn't a recognised a built in function.
Sorry, I'm not really much of a SQL guy. Thanks for any help
I need a little help with a SQL Server 2005 query I'm trying to do.
Basically I have a table that contains multiple columns, two of which are ARC_DOCMONTH and ARC_DOCYEAR that contain the current month and year respectively. The datatype of both is varchar.
I need to return all records that have the current month and year in those two columns. I thought I could do something like:
Code:
SELECT ARC_DOCINVOICENO, ARC_DOCDAT
FROM CpArchiveIndex
WHERE ARC_DOCMONTH = Month(NOW()) ORDER BY ARC_DOCDAT ASC
But I always get the error that Now() isn't a recognised a built in function.
Sorry, I'm not really much of a SQL guy. Thanks for any help