[thelist] SQL query help

Tarrant Costelloe taz at insur-e.net
Fri Nov 8 06:06:08 CST 2002


Thank you that is VERY helpful, much appreciated.

-----Original Message-----
From: listman at hazard0us.org [mailto:listman at hazard0us.org]
Sent: 08 November 2002 11:45
To: thelist at lists.evolt.org
Subject: RE: [thelist] SQL query help


If you are using SQL Server you can use datepart () :

Select * from TableName
Where datepart(mm, DATE) = 12
Order by hits

will fetch all the records from TableName for the month of december.
Access also has a datepart function , you have to put the mm  in quotes
like this :

datepart("mm", Date)

Note : if your DATE field is not of data type DATETIME you will
need to cast() or convert() it explicitly into a datetime type.


HTH
ashok

------
Ashok Hariharan
http://www.unganisha.org
------



--
For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !

Please support the community that supports you.
http://evolt.org/help_support_evolt/



More information about the thelist mailing list