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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Most Urgent : Datetime Query not working

Status
Not open for further replies.

RushiShroff

Programmer
Jan 23, 2002
216
IN
MS-Access does not support

select * from tblnm where dateField < #somedate#&quot;

so I have a date range.
I want to select records on the basis of that .

How can I do it in ASP ? Rushi Shroff Rushi@emqube.com
&quot;Life is beautiful.&quot;
 
Hi Rushi!

It does, you know! If you are doing a query put the &quot;<#15/12/2002#&quot; in the criteria for the datefield, run the query and look at the sql.

If in doubt, remove all spaces from the expression and put both sides in brackets. Derren
[Mediocre talent - spread really thin]
 
sorry Darren
No combination works

select * from m_account where (Account_Created_Date)<(#20-Mar-02#)

select * from m_account where (Account_Created_Date)<(#21/03/2002#)

select * from m_account where (Account_Created_Date)<(#03/21/2002#)

Any more suggestions !!
Please ?? Rushi Shroff Rushi@emqube.com
&quot;Life is beautiful.&quot;
 
Is it giving you an error or just not returning any records? Derren
[Mediocre talent - spread really thin]
 
Extremely sORRY dERREN,
it is showing me results
I was getting misunderstood looking at the last NULL row where date was coming default-today's date

So was getting misunderstood.

Well I am inserting now() in the field havig datatype DAteTime so it inserts time as well

Now problem is if I write >&quot;#15/03/2002#

It showes me records of 15/03/2002 2:30:00 PM also which should not come.
What to do ..?? Rushi Shroff Rushi@emqube.com
&quot;Life is beautiful.&quot;
 
Simple, just add a time to the end of the date:

Code:
>#15/03/2002 23:59#

This will ensure that it will give you all the records that have a daye of 16/03/2002 and greater. Derren
[Mediocre talent - spread really thin]
 
Or

Code:
>=#16/03/2002#

Will do the same thing

Derren
[Mediocre talent - spread really thin]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top