Results 1 to 6 of 6
  1. #1
    taimysho0 is offline Competent Performer
    Windows XP Access 2000
    Join Date
    Nov 2011
    Posts
    286

    Selecting value with only today or yesterday's date In Query (day/month only)

    Hello, i have a query that searched for certain string criteria in a column. How do i have it only find values that have a Date in front of the text? However, the date is in the form of 5/24 for example. There is no year.

    There are only two possibilities what what the date would look like either between Date() and Date()-1 or Date() and Date()-2. For example, it would look like this is in the field:


    either "5/24 - 5/22 is missing data" <---between date() and date()-2

    OR

    "5/24 - 5/22 is missing data" <---between Date() and date()-1

    The way i have the query right now is just find anything that says "missing data", how do i add the date criteria also?



    maybe something like: Like Date() & " - " Date()-1 & "is missing data"??

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Try this:
    Like CStr(Format(Date(),"m/dd")) & " - " & CStr(Format(Date()-1,"m/dd")) & " is missing data"
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    taimysho0 is offline Competent Performer
    Windows XP Access 2000
    Join Date
    Nov 2011
    Posts
    286
    hrmm i have lines with "5/24 - 5/22 is missing data" and is still not being pulled up in the query. Does it matter what format that column is in? currently its jut text

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    To return that row you would need:
    Like CStr(Format(Date(),"m/dd")) & " - " & CStr(Format(Date()-2,"m/dd")) & " is missing data"
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    taimysho0 is offline Competent Performer
    Windows XP Access 2000
    Join Date
    Nov 2011
    Posts
    286
    nvm, looks like i got it. thanks so much!

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Glad to help.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. Replies: 12
    Last Post: 04-26-2012, 04:01 AM
  2. Replies: 4
    Last Post: 03-23-2012, 01:18 PM
  3. Query re-run for Tomorrow/Yesterday
    By mseeker22 in forum Queries
    Replies: 3
    Last Post: 06-13-2011, 11:14 AM
  4. Month To Date Query
    By jmorse in forum Queries
    Replies: 3
    Last Post: 03-11-2011, 11:25 AM
  5. query date that is five years older than today
    By cpsummer in forum Queries
    Replies: 2
    Last Post: 09-26-2007, 02:31 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