?
Solved

MS Access date formatting

Posted on 2011-04-28
7
Medium Priority
?
453 Views
Last Modified: 2012-05-11
Hi Gang... I have a query that retrieves a date fiield stored as text :-( and then formats it as such

>=Format([Forms]![frm_Select Rx Date Range]![ctlRxStartDate],"yyyymmdd") And <=Format([Forms]![frm_Select Rx Date Range]![ctlRxEndDate],"yyyymmdd")

How can I make this date range be +1 day?
0
Comment
Question by:hwassinger
  • 3
  • 3
7 Comments
 
LVL 9

Expert Comment

by:sshah254
ID: 35488908
0
 
LVL 52

Expert Comment

by:Gustav Brock
ID: 35489304
Try this:
>=Format([Forms]![frm_Select Rx Date Range]![ctlRxStartDate],"yyyymmdd") 
And 
<=Format(DateAdd("d",1,[Forms]![frm_Select Rx Date Range]![ctlRxEndDate]),"yyyymmdd")

Open in new window


/gustav
0
 

Author Comment

by:hwassinger
ID: 35490440
cactus, this is close but I need BOTH dates to be +1. This is Necassary as the user is entering the date in a form and I need to carry it from 1 query to another as the query must cross a date line due to work hours
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:hwassinger
ID: 35490457
>=Format(DateAdd("d",1,[Forms]![frm_Select Rx Date Range]![ctlRxStartDate],"yyyymmdd") And <=Format(DateAdd("d",1,[Forms]![frm_Select Rx Date Range]![ctlRxEndDate]))

Seems to fail and resets itself back to

>=Format([Forms]![frm_Select Rx Date Range]![ctlRxStartDate],"yyyymmdd") And <=Format(DateAdd("d",1,[Forms]![frm_Select Rx Date Range]![ctlRxEndDate]))
0
 
LVL 52

Accepted Solution

by:
Gustav Brock earned 1000 total points
ID: 35490468
That would be:
>=Format(DateAdd("d",1,[Forms]![frm_Select Rx Date Range]![ctlRxStartDate]),"yyyymmdd") 
And 
<=Format(DateAdd("d",1,[Forms]![frm_Select Rx Date Range]![ctlRxEndDate]),"yyyymmdd") 

Open in new window


/gustav
0
 

Author Closing Comment

by:hwassinger
ID: 35490676
Thanks!
0
 
LVL 52

Expert Comment

by:Gustav Brock
ID: 35490751
You are welcome!

/gustav
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question