PDA

Click to See Complete Forum and Search --> : Database


Chrisitina
Aug 12th, 1999, 02:12 PM
Hi all
in my coding, I need to retrieve records from Informix database. Belos is my select statement.

Firstly I will get the date to retrieve data from user.

"Select * from temp where ret_dte <=" '"& user_dte"'

I can't retrieve any data from the above statement but using the statement below, I am able to retrieve records.

"Select * from temp where ret_dte <= '12/08/1999'"

Can some1 pls enlighten me.

Skrmetti
Aug 12th, 1999, 05:36 PM
Try

"Select * from temp where ret_dte <= '" & user_dte & "'"

That's assuming user_dte is a user-input variable and ret_dte is a field name, which seems implied in your second statement.

HTH,
Jonathan

Serge
Aug 12th, 1999, 07:04 PM
The reason you didnt have results using variable is because you have single quotes in wrong places.

This is your statement:
Select * from temp where ret_dte <=" '"& user_dte"

This is the statement that should be:
Select * from temp where ret_dte ='" & ser_dte & "'"


Regards,

------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com