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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Conversion

Status
Not open for further replies.

hawg9

IS-IT--Management
Nov 9, 2005
22
US
I have multiple fields where the date is imported as M/D/YYYY. I need to find a way to convert it to YYYYMMDD.
 

Hi,

Code:
Format([MyDate],'yyyymmdd')


Skip,

[glasses] [red]Be Advised![/red]
The band of elderly oriental musicians, known as Ground Cover, is, in reality...
Asian Jasmine![tongue]
 
Skip,

I got a validation rule violation and I think it is because this data is imported into a database as a text field. Do you have any suggestions on how I can get around this other than having to have someone re-import the data and change the field types?

Thanks
 


Does it matter that you don't REALLY have a date in your table?

Skip,

[glasses] [red]Be Advised![/red]
The band of elderly oriental musicians, known as Ground Cover, is, in reality...
Asian Jasmine![tongue]
 
No, not if I can get the format to look correct
 


So you will NEVER use the "date" to calculate anything, huh?
Code:
sLooksLikeDate = Format(DateValue([MyDateString]),'yyyymmdd')


Skip,

[glasses] [red]Be Advised![/red]
The band of elderly oriental musicians, known as Ground Cover, is, in reality...
Asian Jasmine![tongue]
 
Will this compensate if there are null values as well?
 


No, and it won't give you a wake-up call either.

Take a look at NZ

Skip,

[glasses] [red]Be Advised![/red]
The band of elderly oriental musicians, known as Ground Cover, is, in reality...
Asian Jasmine![tongue]
 
Skip,

in addition, i have set these fields to have a default value now and when I run the first query, it should populate the default values. For some reason, some of the fields are not being populated with the default values that I have defined. Do you have any suggestions?

Thanks -

Chris
 


Not only will you not get a wake up call, but my crystal ball is a tad cloudy -- well, REALLY foggy!

I need to see the code that you are referring to.

Skip,

[glasses] [red]Be Advised![/red]
The band of elderly oriental musicians, known as Ground Cover, is, in reality...
Asian Jasmine![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top