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

Pound signs (#) around date or time

Status
Not open for further replies.

scc

Programmer
Apr 30, 2001
218
US
I just read through some VB code where the user puts #'s around the date or time when initializing a variable.

I have never heard of this in VB. I was told that this is a best practice in VB, but I wasn't able to find it in VB help. I'm using VB 6.

Can someone else shed some light on this?

TIA
 
Sorry... I should have clarified a bit more. This is used with SQL Server (not Access).

An example of how this is set would be:

StartDate = "01/01/04"

Thanks
 
Date literals are required to be deliminated by '#'s by SQL server.

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
and also in american format I believe.

There has been significant discussion abou this in the past.

try searching for date literals

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Suggest you check out your help files Matt!

In MSSQL dates are normally delimited with single quotes < ' >

In Access dates are delimited with < # >

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Right, johnwm. Access is the one that doesn't follow the SQL standard.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
oops
<red faced>

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top