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 in an SQL statement

Status
Not open for further replies.

chasbrouck

Programmer
Jan 15, 2002
6
US
Hello,

I was hoping someone here may be able to help me out. I am connecting to an ORACLE Database and doing some processing. One of the things I need to do is pull records that have a value in a field called START_DT that is greater than the Current date.

Here is what is a portion of my where clause:

AND (SISI.CASE.START_DT > CurDate)

The value of Curdate is set by using the NOW() function in a VB script to pull the current date.

I know what I have here is no correct, can anyone point me in the right direction?

Thanks,
Chris Hasbrouck
Software Developer/Programmer
Bassett Healthcare

 
Are you building an sql string to send to the server? You need to concatenate the different parts of the string to resolve variables before the final string is complete. The date literal needs to be surrounded by quotes - In Sql server it is single quote, I am not sure about Oracle.

dim sql as string

sql = "Select etc.....AND (SISI.CASE.START_DT > "
sql = sql & " '" & CurDate & "') "
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top