Results 1 to 4 of 4

Thread: Is this query correct???

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2003
    Location
    michigan
    Posts
    70

    Is this query correct???

    Is this query correct??

    Hi I am having a date(text) in one variable.
    And the format of date variable in the access database is
    m/d/yyyy.
    Is the following query correct to do that.

    The variable num has got a date of type string sth like 7/1/2003.

    And the date format in access is m/d/yyyy

    SELECT Sum(Poamount),Buyer FROM stats where Buyer='Brad' and date='&num&'group by Buyer order by Buyer

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    replace the &num& with #num#, assuming num is a valid date format in the format of MM/d/yyyy

  3. #3
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    here you goo

    SELECT Sum(Poamount) as total,Buyer FROM stats where Buyer='Brad' and date='#num#' group by Buyer order by Buyer

  4. #4
    Hyperactive Member sw_is_great's Avatar
    Join Date
    Nov 2003
    Posts
    330
    or use something like

    to_date function
    Regards

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