Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2005
    Posts
    26

    Unanswered: Query criteria: date field = current date

    I have a table, where one field is filled with dates. I want to run query and show me only those results which date's month is equal to current month.

    in vba there is month(date) function, but is there anything like that in jetsql? i couldn't find anything.....


    Thanks

  2. #2
    Join Date
    Nov 2005
    Posts
    26
    Ok i firgured out myself

    Criteria:

    month([datefield])=month(Now())

  3. #3
    Join Date
    Nov 2005
    Posts
    26
    Ok, i need some more help with jetsql....

    I have a table with two fields: Client and Date. I need to select all clients that have date which is equal to current date (comparing by months only), but if there are two or more same clients for current month,I need to select the latest date (higher number?) and show only one unique client per result...


    ClientA 2006.02.01
    ClientB 2006.02.02
    ClientA 2006.02.03
    ClientC 2006.03.01


    Result:

    ClientB 2006.02.02
    ClientA 2006.02.03


    I can make first part (to select by current month) but how to get higher number from this result if client is the same..?

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    SELECT client, Max(yourDate)
    FROM yourTable
    WHERE month(yourDate) = month(Date())
    GROUP BY client
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Nov 2005
    Posts
    26
    Thanks, its ok now

Posting Permissions

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