VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

SQLDate

James Wilson  (2 Submissions)   Databases/Data Access/DAO/ADO   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

Dates in SQl queries often cause problems, as the date must be in the ANSI format whereas dates brought back can be in a different local format. This function simply returns the date in the required format and save having to type Format(DateString, "mm/dd/yy") every time.

Inputs
The date to be processed as type DATE.

Assumes
Example SQl Query- SQL = "SELECT * from tblTest" SQL = SQL & " WHERE StartDate = #" & SQLDate(DateToConvert) & "#

Returns
A STRING containing the date formatted to the correct criteria.

API Declarations

Rate SQLDate (4(4 Vote))
SQLDate.bas

SQLDate Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters