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

How to get only date part...vb 6 front-end , oracle back-end

Status
Not open for further replies.

bnath

IS-IT--Management
Apr 7, 2003
16
US
I am using Oracle 8i as back-end. Date and time is stored in a field . the content of the field is 3/10/2005 5:00:03 PM

I am trying to write a query (in VB 6) where I want see if the today's date matches with the date (not the time) stored in that field. this is how I wrote and it doesn't work.

"select count(*) from xxx.tblname WHERE AV_UPDATE_DATE = to_DATE('" & Format(Now(), "DD-MMM-YYYY") & "', 'DD-Mon-YYYY')"

oRS.Open strSQL, cnn, adOpenForwardOnly, adLockPessimistic

The data in the av_update_date field is 3/10/2005 5:00:03 PM.
So when I ran this statement today (03/11/2005), the recordcount should be zero. but it is showing as 1.

What is the mistake I am doing?
Pls suggest.

thanks
nath
 
Try formatting BOTH dates to the same string format and then comparing them.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top