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

    Angry Unanswered: Re: Where clause is 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
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    DELETED

    izy
    Last edited by izyrider; 01-10-05 at 13:20. Reason: oooops - didn't see SQL-Server
    currently using SS 2008R2

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Not working

    You may need to use a # instead of ' for the where statement on the date fields.

Posting Permissions

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