Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002
    Posts
    395

    Angry Unanswered: RE: WHERE clause not working

    Hi,
    Could someone tell me why the first criteria works but when second is added the where statement doesn't work (No records displayed.) I'm using AC2K and SQL Server 2000.
    Thanks much!

    str = "SELECT dbo.tblShipping_sched.cust_name, dbo.tblShipping_sched.cust_part_num, "
    str = str & "SUM(dbo.tblallBag_data_bak.bag_quantity) AS quantity "
    str = str & "FROM dbo.tblallBag_data_bak INNER JOIN "
    str = str & "dbo.tblShipping_sched ON dbo.tblallBag_data_bak.work_ord_num = dbo.tblShipping_sched.work_ord_num "
    str = str & "AND dbo.tblallBag_data_bak.work_ord_line_num = dbo.tblShipping_sched.work_ord_line_num "
    str = str & "WHERE (dbo.tblallBag_data_bak.sample_completed >= '" & Forms!date_range_sampling_sched!Beginning_date & "' "
    str = str & "AND dbo.tblallBag_data_bak.sample_completed <= '" & Forms!date_range_sampling_sched!Ending_date & "') "
    str = str & "GROUP BY dbo.tblShipping_sched.cust_name, dbo.tblShipping_sched.cust_part_num

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Have you looked at the value of str before you execute it to see if the value is what you expect?

    -PatP

Posting Permissions

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