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!

Want to pass date ONLY to a stored proc

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have created a stored proc on MS SQL 7.0 to pass a parameter like:

CREATE PROCEDURE dbo.SpCommission @StartDate DATETIME as

When the paramter is kicked off in Crystal 8.5 it is a datetime field. I would like to eliminate the time. I havent found a way to declare @StartDate as a DATE only in SQL. Is there a way to do that?? or is there a way I can do this in Crystal so that the time wont be shown when entering in the date. Thanks!!
 
SQL Server 7 has only two date types, both of which include a time value - DATETIME and SMALLDATETIME.
If you want to pass just a date value from Crystal Reports, you can pass a string version of the date as a string parameter to the stored procedure, and assign that string to a datetime variable in the stored procedure (or just use it in string format). See the SQL Server BOL for details on what string formats work for your language setting. Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top