Remove the single quotes around the m and you'll be fine, i.e.:

        DatePart(m,eventdate)

instead of

        DatePart('m',eventdate)

The best reference for SQL Server is the T-SQL Help, available from the help
menu of the query analyzer. It's really one of the better help files I've
seen.

As far as books, you probably want Inside SQL Server 7.

Also, if you're interested in ADO at all (yes, blasphemy!), get Hitchhiker's
Guide to Visual Basic and SQL Server 7, which I personally think rates with
Larry Wall's Learning Perl as one of the few truly readable reference books.

Michael Caulfield

-----Original Message-----
From: Diana Nichols [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 03, 2001 4:15 PM
To: CF-Talk
Subject: query dates


Can someone tell me how to specify part of a date in SQL 2000?

i.e. WHERE DatePart('m',eventdate) = #thismonth#

Worked fine in Access....

Also, until I can get more SQL books, is there a good online resource for
stuff like this? All I can find are basic tutorials and performance tips....

TIA!!


*************
Diana Nichols
Webmistress
http://www.lavenderthreads.com
770.434.7374

"One man's magic is another man's engineering." ---Lazarus Long
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to