Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP WITH DATE()

Status
Not open for further replies.

gradinumcp

IS-IT--Management
Apr 6, 2005
85
US
Hi there! I need help with a sql query where i have a DateStamp column with values like 5/10/2005, 4/11/2006 etc.

Now since todays date is 09/19/2005, I want to pull only those values that have year as 2005. Once the year changes to 2006 I want to pull values for 2006 only. So basically depending on the day the report is being pulled i need the appropriate values.

Here's the query:

mysql="SELECT DateStamp FROM TimeTracking WHERE DateStamp LIKE '%Year()%'"

What should go instead of code in red????

 
or
mysql="SELECT DateStamp FROM TimeTracking WHERE DateStamp LIKE 'year%'"

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top