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

Comparing dates

Status
Not open for further replies.

savok

Technical User
Jan 11, 2001
303
AT
How can I compare 2 date fields, one coming from an oracle table another from VB text box. I need to format them somehow so I can compare them but have no clue how.

txtDate = Format(txtDate.Text, "mm/dd/yyyy")

Select * from table where date_field > '" & txtDate & "'

I need to format date_field to the same format as txtDate. Anyone know how I can do this?

Something like
Select * from table where (date_field, 'mm/dd/yyyy') > '" & txtDate & "';

Anyone know the correct syntax?

 
ahhh found it ;) in case anyone interested


Select * from table where date_start > to_date('" & txtDate & "', 'MM/DD/YYYY')"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top