Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I use AM/PM in a Date Time format?

Status
Not open for further replies.

KenG

Technical User
Mar 20, 2000
67
0
0
US
I have a bound text box that is formatted to display the date as follows:<br>15-Aug-00-AM <br>using the format &quot;dd-mmm-yy-AM/PM&quot;<br>In the underlying field the data appears with the complete date and time.<br><br>Is there anyway to force the data to be recorded as is appears in the form, either by other formats, functions or code?<br>
 
I found it best just to put data in a &quot;Date&quot; field with the &quot;Date/time&quot; format is like so:<br><br>rst!DateField = format(now,&quot;mm/dd/yy&quot;)<br>rst!TimeField = format (now,&quot;hh:nn&quot;)&nbsp;&nbsp;'&lt; no &quot;n&quot; is not a typo<br><br>then if you want something else use a report or form to show it differently. But Leave the Table, or query results alone.<br><br>so in your form or report:<br><br>Me!TimeBox = format(rst!TimeField, &quot;hh:nn AM/PM&quot;)<br>Me!DateBox = format(rst!DateField, &quot;dddd mmm/dd/yyyy&quot;)<br><br><br>Been doing it that way for years and it works great.<br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top