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!

problem with date

Status
Not open for further replies.

parames

MIS
Jun 26, 2000
71
MY
hi list..
need help..

i'm using My Sql database.. one of my table fiels is a date field.. so it store the date value in this format, '2001-01-31'

Now, i must do a comparison with Date() function. This Date() function return value in this format, '31/01/01'

so ,if i do something like this

tarikh=Date()
Query = "select * from sales where deldate > '"&(tarikh)&"' AND deldate - '"&(tarikh)&"' = 1 OR deldate = '"&(tarikh)&"'"
Set RS2 = Conn.Execute(Query)

i still cannot get the data.. please guide me how to do this..

thanks a lot..

parames.s
 
parames,

First display your SQL STATEMENT in your browser output like this:

tarikh=Date()
Query = "select * from sales where deldate > '"&(tarikh)&"' AND deldate - '"&(tarikh)&"' = 1 OR deldate = '"&(tarikh)&"'"
Response.Write Query
Set RS2 = Conn.Execute(Query)

Now copy the SQL STATEMENT text from the browser into your My Sql environment and run it. If it fails then that is a SQL question and perhaps a My Sql question.

Hope this helps
-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top