Results 1 to 5 of 5

Thread: Sql String Help Pls

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2001
    Location
    Melbourne
    Posts
    38

    Question Sql String Help Pls

    sqlstring = sqlstring & "from booking where booking.bookingid = bookingid"

    whats wrong with that select statement?
    when i run it,it suppose to give me fields for specific booking id, but it shows specific fields for all booking

    need help pls

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    I would need to see the whole SQL statement to be able to answer that.

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2001
    Location
    Melbourne
    Posts
    38
    dim bookingid as integer

    lstbookingid = bookingid
    'lstbookingid is a listbox

    select bookingdate from booking where bookingid = bookingid

  4. #4
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Try this:

    Code:
    bookingid = lstbookingid.List(lstbookingid.ListIndex)
    You also may have to convert bookingid to the correct data type,
    depending upon you table definitions.

  5. #5
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    I don't get it!
    You don't assign a value to bookingid (but you're trying to assign bookingid to a listbox).
    Then in your first post you have the following code:
    VB Code:
    1. sqlstring = sqlstring & "from booking where booking.bookingid = bookingid"
    What value does the sqlstring have for value to start with? And does it end with a space so there is a space before it adds "from booking" to it?

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