Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    55

    Unanswered: Query works in test environment, but not live ? ? ?

    I have a mirrored database on my machine, along with a mirrored website for my testing. I am running a query on my local machine that is working...
    basicly just selecting to view a set of records if a value is Yes or No and between a date range selected by a user.
    In my test environment the data is being filtered and fed to the user properly, but in the live environment I seem to only be pulling the information given by my assigned default values. The query doesn't seem to be pulling the values passed on by the form.
    I had directly copied the pages over, so I can't see why it's not working.
    Does it sound like there's something I'm missing here?
    I'd appreciate any help.
    Thanks, Ray

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    what is the query? which database version is each server? is the data the same?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2004
    Posts
    55
    It works now,
    I'm pretty new at this and my sql was a bit off, but I still can't understand why it was constantly working in one environment and not the other.
    Anyway, I got the sql straightened out and now it works fine in both live and test.
    Another question, would there be a better way to do a date search than the way I've included in the attached pic? I seem to run into a snag when I want to search for a startdate of 2005-01-01 and 2005-01-31, it's not picking up the events on 2005-01-31 (probably because it's searching for 2005-01-31 00:00:00, right?)
    I tried to search for >= 'qdate1' AND <= 'qdate2'
    but I received an error.
    Attached Thumbnails Attached Thumbnails sql.JPG  
    Last edited by purpendicular; 02-14-05 at 14:58. Reason: correct some type

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by purpendicular
    probably because it's searching for 2005-01-31 00:00:00, right?
    right

    change it to

    ... where foo >= 'qdate1' and foo < date_add('qdate2' , interval 1 day)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Mar 2004
    Posts
    55
    got it, cool, thanks a lot!!

Posting Permissions

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