+ Reply to Thread
Results 1 to 5 of 5

Thread: query string value expression problem

  1. #1
    Contracted Slave Centurion is on a distinguished road Centurion's Avatar
    Join Date
    Dec 2008
    Posts
    533
    Rep Power
    4

    query string value expression problem

    Hi,

    below is my query from my ASP page:

    Code:
    sql= "SELECT shows.[showID], shows.[showName], performances.[performance_time] FROM shows INNER JOIN performances ON shows.[showID] = performances.[showID] WHERE shows.[showName]='"& showName & "' AND performances.[performance_time]='"&performance_time & "'"
    
    when i debug response.write SQL i get this :

    Code:
    SELECT shows.[showID], shows.[showName], performances.[performance_time] FROM shows INNER JOIN performances ON shows.[showID] = performances.[showID] WHERE shows.[showName]='Godzilla' AND performances.[performance_time]=''
    Oops! No records found!
    
    any ideas?

  2. #2
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Do you actually have shows where performances.[performance_time]='' ?? Otherwise, it would seem that your performance_time variable is empty.
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  3. #3
    Contracted Slave Centurion is on a distinguished road Centurion's Avatar
    Join Date
    Dec 2008
    Posts
    533
    Rep Power
    4

    Quote Originally Posted by jmurrayhead View Post
    Do you actually have shows where performances.[performance_time]='' ?? Otherwise, it would seem that your performance_time variable is empty.
    i have shows:

    Code:
    [1] | Godzilla | 1:00
    [2] | Godzilla | 2:00
    [3] | Godzilla | 3:00
    
    running the query in access produces the correct result.. :s

  4. #4
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    It returns the correct result when you don't provide a performance_time value??
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  5. #5
    Contracted Slave Centurion is on a distinguished road Centurion's Avatar
    Join Date
    Dec 2008
    Posts
    533
    Rep Power
    4

    Quote Originally Posted by jmurrayhead View Post
    It returns the correct result when you don't provide a performance_time value??
    J,

    I figured it out. My own fault, had uppercase and lower case in the database and it wasnt the same in the ASP page. Also added square brackets around the column names. Let that be a lesson to anyone designing there database

+ Reply to Thread

Similar Threads

  1. Query problem
    By todd2006 in forum ASP Development
    Replies: 5
    Last Post: September 12th, 2009, 07:32 AM
  2. Regular expression
    By guddu in forum ASP Development
    Replies: 9
    Last Post: August 26th, 2009, 01:36 AM
  3. Query Problem
    By micky in forum SQL Development
    Replies: 2
    Last Post: May 25th, 2009, 05:12 AM
  4. string problem with < and >
    By guddu in forum ASP Development
    Replies: 2
    Last Post: May 6th, 2009, 12:09 PM
  5. Data Type Mismatch in Criteria Expression
    By alansidman in forum Microsoft Access
    Replies: 1
    Last Post: April 9th, 2008, 05:33 PM

Bookmarks

Posting Permissions

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

SEO by vBSEO