Results 1 to 3 of 3

Thread: Database

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 1999
    Posts
    1

    Post

    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.

  2. #2
    Member
    Join Date
    Jul 1999
    Posts
    33

    Post

    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

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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
    [email protected]
    [email protected]



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width