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

Urgent Help Needed

Status
Not open for further replies.

EscapeUK

Programmer
Jul 7, 2000
438
GB
How do I pass a date/time to Crystal from VB. What format should it be in.

Could someone supply some code
 
There are many ways but so as to avoid any 'formatting' interference by various system's settings ...

Probably best to pass as a string.

In Crystal Reports:

Insert|Formula
New

Name it VBDateTime

Put a default in such as "01/01/1980 12:00:00"
Then you know wheteher your passing has worked or not.

In VB :

Dim gsDateTime as String

gsDateTime="20/04/2001 12:07:05"

CrystalReport1.Formulas(0) = "VBDateTime = " & gsDateTime

Note: you could do a similar thing with Parameters but you would need to enter a date everytime you ran the report in development. Your choice.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top