Results 1 to 2 of 2

Thread: date problem

  1. #1
    Join Date
    Oct 2009
    Posts
    7

    Unanswered: date problem

    hi every one
    i have a date problem
    i have the query

    SELECT Stock.change_date, Stock.printer_ink, Stock.old_stock_value, Stock.new_stock_value
    FROM Stock
    WHERE (((Stock.change_date)=#1/11/2009#) And ((Stock.printer_ink)=15));


    which i need to select date 01/11/2009 as dd/mm/yyyy

    the table contains data in this date

    but doesn't get it

    when i see the query in design view it have the criteria #11/01/2009# in the change_date which convert my date to mm/dd/yyyy what i would do to tell the query that i want the date in the dd/mm/yyyy format


    thanks

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    You may want to look at how Access stores date/times; so when you say "(Stock.change_date)=#1/11/2009#", you're telling Access you only want records with the change date exactly equal to 1/11/2009 at midnight, as opposed to any record that happens on that date regardless of the time on that date. What I think you actually want is something more like:
    Code:
    SELECT Stock.change_date, Stock.printer_ink, Stock.old_stock_value, Stock.new_stock_value
    FROM Stock
    WHERE ((Date([Stock].[change_date])=#1/11/2009#) AND ([Stock].[printer_ink]=15));
    Give it a shot at least, see if that helps
    Me.Geek = True

Posting Permissions

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