Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25
  1. #16
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    and sql view : dbo_location_mstr1.alt_phone_ext, dbo_appointments1.appt_kept_ind
    HAVING (((dbo_appointments1.appt_date) Between "20131201" And "20131208") ----. I change it back to the original date.

    Hope this helps??
    Thanks.

  2. #17
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    If that works, the data type of appt_date has to be text, not date/time. You'd get a data type mismatch otherwise.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #18
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    So How do I set it as text? below is the sql view

    here is in sql view:

    dbo_location_mstr1.alt_phone_ext, dbo_appointments1.appt_kept_ind
    HAVING (((dbo_appointments1.appt_date) Between Date()-"7" And Date())

  4. #19
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    And I do get mistmach error whats the best way to d o this so I can set it automatically to retrieve the last 7 days?
    .Thanks.

  5. #20
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    I tried this but not working: DateAdd("d",-7,("date()",ConvertText("varchar",Date(),101)))

  6. #21
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Try something like

    Between Format(Date()-7,"yyyymmdd") And Format(Date(),"yyyymmdd")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #22
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    YES!!!!!!!!!!!!!!!!!!!!!!!!!!! that did it ...!!!!!! YOU ROCK!!!!!! Paul! Thanks so much!!!!!!!!!! I owe you one!

  8. #23
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    Paul One more thing,, should I set the -7 to -6 since it includes the todays date?

    Thanks!!!

  9. #24
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help! You can certainly change the days to be subtracted to meet your needs.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #25
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    Thank you! you Rock!!!

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 12-02-2013, 03:46 PM
  2. Replies: 1
    Last Post: 10-18-2013, 03:14 PM
  3. IIf Query with dates
    By DelbyJones in forum Access
    Replies: 2
    Last Post: 08-16-2012, 02:33 PM
  4. Query input dates for range of dates in two fields
    By kagoodwin13 in forum Queries
    Replies: 3
    Last Post: 02-13-2012, 04:25 PM
  5. Run Query by dates
    By BorisGomel in forum Access
    Replies: 3
    Last Post: 07-21-2011, 03:54 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