Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009
    Posts
    1

    MS Access Query DateTime and Condition...Its URGANT

    Hi I have access table like….

    OrderID Price OrderDate
    4123 856.41 20/01/2008


    4126 -52.86 21/01/2008
    4562 785.23 23/02/2009
    4862 62.86 23/02/2009

    MS Access query I am looking

    OrderID Price OrderDate EndOfMonthDate Status
    4123 856.41 20/01/2009 31/01/2008 Pass
    4126 -52.86 21/01/2009 31/01/2008 Fail
    4562 785.23 17/02/2009 28/02/2008 Pass
    4862 62.86 24/02/2009 28/02/2008 Pass

    ** EndOfMonthDate column is end date of OrderDate like for January 2009 end date is 31st Jan 2009
    ** Status column If Price is greater than or equal to Zero than PASS else FAIL.

    Any MS-Access SQL Query? Its urgant…thanks….

  2. #2
    thhui is offline Competent Performer
    Windows XP Access 2002 (version 10.0)
    Join Date
    Feb 2009
    Posts
    235
    Just put this in SQL Query:-

    SELECT Orders.OrderID, Orders.Price, Orders.OrderDate, DateSerial(Year([Orderdate]),Month([Orderdate])+1,0) AS EndOfMonthDate, IIf([Price]<0,"Fail","Pass") AS Status
    FROM Orders;

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Using a form to apply a condition to a Query
    By JeepWidow in forum Forms
    Replies: 0
    Last Post: 12-22-2008, 10:29 AM
  2. How to use IIF condition
    By nshaikh in forum Queries
    Replies: 4
    Last Post: 09-12-2008, 01:23 AM
  3. HELP with NULL DateTime VALUES
    By lfolger in forum Programming
    Replies: 3
    Last Post: 03-28-2008, 02:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums