PDA

View Full Version : Access Date Formatting



FrymanTCU
10-09-2007, 07:15 AM
I have been working on a VB6 program for time tracking purposes, which we have tied to an Access database to create reports. I built the VB with Drop down boxes for the time to minimize input errors. I am storing these values as text in Access and using a Query to combine them but it is making for a mess to get the formatting correct. Is there a script I can run before I tie it to Access or a better way to combine in the query than:



In Office Time: IIf([In Office - Hour]<>"",(TimeValue(EntryTable![In Office - Hour]+":"+EntryTable![In Office - Min]+" "+EntryTable![In Office - am/pm])),"")


Thanks in advance for your help, I have been viewing for awhile and this is my first post:hi: . Everyone here seems to be a great help, I have learned alot on this site.

Oorang
10-09-2007, 01:22 PM
For the way you stored it, I'd say that's just about the only way to reconstruct it. If I might be so bold, I would suggest using unbound controls to get the Date/Time values and when you are ready to store the record combining them into a standard date/time serial. Then you can just store them in the the table as date. You only ever do the work once this way.