Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Mar 26, 1999

Do You Know About Date Literals?

Using a Date literal is about 12 times faster-according to NuMega TrueTime-than using the CDate function and converting a string literal. Here's an example:
 
Dim TestDate as Date
	'The following 2 lines produce the same results
	TestDate = #7/1/98#
	TestDate = CDate("7/1/98")
Just as you enclose a string literal with quotes ("Hello"), you can enclose Date literals with pound signs (#07/07/1998#). So, these are all valid Date literals: #July 7, 1998#, #7-JUL-98#, and #07/07/1998#
James Bragg
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date