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

Converting Date type?

Status
Not open for further replies.

ef61778

IS-IT--Management
Sep 23, 2003
14
US
How would I convert the Date type to format yyyymmdd

I have:

Dim strCGID As String
Dim yyyymmdd As Date

strCGID = "DA" & yyyymmdd

I would like strCGID to be DA20030926

However I am getting DA12:00AM


 
strCGID = "DA" & Format(date,"yyyymmdd")


peterguhl@yahoo.de
 
Dim strDate As String

strDate = Format$("09/07/2003", """D""" & "A:YYYYDDMM")

MsgBox strDate
 
Try this,

Code:
Debug.Print "DA" & Format(Date,"yyyymmdd")

Thanks and Good Luck!

zemp
 
>> Dim yyyymmdd As Date
You have created a variable named yyyymmdd with type data but it's not a definition of a format.

peterguhl@yahoo.de
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top