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

Datetime field -- VB and Crystal reports OCX and SQL Server 2000

Status
Not open for further replies.

Tigger9969

Programmer
Nov 27, 2001
7
CA
I know there is a lot of dicussion about datetime fields, but I couldn't find something that would help.

Here's the question:

I have a stored procedure in sql server 2000. In crystal reports, when I view the data and it prompts me for the parameter, I have to enter the exact date and time. If I just enter the date, it doesn't work.

So when I'm in VB and try to pass it a datetime value, nothing works, but I'm not sure of the proper syntax.

What's the easiest way around this?

Tigger9969


 
I am not sure but I think that the stored procedure is sending you the values as text. Try this format:
"YYYYMMDD HH:MM:SS" Note the space.

I hope it works. Howard Hammerman,

Crystal Reports training, consulting, books, training material, software, and support. Scheduled training in 8 cities.
howard@hammerman.com
800-783-2269
 
Thanks for your help but I found a way around it differently.

In my Stored procedure, I used the cast function and casted the datetime field to a varchar, this way when I pass the values in I can send them as strings instead.

Thanks again.

Tigger9969

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top