Apr 23, 2001 #1 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
How do I pass a date/time to Crystal from VB. What format should it be in. Could someone supply some code
Apr 25, 2001 #2 olympian Technical User Sep 11, 2000 13 GB 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. Upvote 0 Downvote
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.