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

Format a field

Status
Not open for further replies.

Pilly170

IS-IT--Management
Aug 28, 2003
36
0
0
US
Hi,

I have some code that retrieves the date/timestamp of a file and saves it into the variable showfileinfo, any ideas how can i get this formatted into a date/time field.?

Function IsFileModifed(filespec)
' This Checks The file as specified in Filespec and checks the modified time then writes a record in DB
Dim fso, f
Dim strSQL As String

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(filespec)

ShowFileInfo = f.DateLastModified

end function
 
Declare the ShowFileInfo variable with the datatype Date? Format the date when updating the table,

[tt]"#" & format(ShowFileInfo, "yyyy-mm-dd hh:nn:ss") & "#"[/tt]

Roy-Vidar
 
I knew it was simple. i been having a mare today. thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top