Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 date parameter value for a datetime field

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-10-25 : 07:55:23
Kenn writes "Greetings.

I need to input a DATE parameter for a field which is DATETIME and can't figure out how to do it.

I tried the following, but it asks me for date and time, and I need to input only date.

Can someone help?

Thanks very much in advance.

Here's the code:

alter procedure up_shipped_not_cogs_by_date

(@startdate datetime,
@enddate datetime )

as

SELECT uv_shipped_jobs_billing.LJOB, uv_shipped_jobs_billing.FCOMPANY, uv_shipped_jobs_billing.ESTDES1, uv_shipped_jobs_billing.SALESPN,
case when uv_shipped_jobs_changeorders.price is null then uv_shipped_jobs_billing.QUOTE
else uv_shipped_jobs_billing.QUOTE + uv_shipped_jobs_changeorders.price end as totalprice,
convert( varchar(20), uv_shipped_jobs_billing.FINALSHIP , 101 )
FROM uv_shipped_jobs_billing LEFT OUTER JOIN
uv_shipped_jobs_changeorders ON uv_shipped_jobs_billing.LJOB = uv_shipped_jobs_changeorders.LJOB
WHERE uv_shipped_jobs_billing.finalship between @startdate and @enddate"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-10-25 : 08:10:10
You can execute it by supplying Dates like '20051010' and '20051025'
Refer this for more information on Dates
http://www.sql-server-performance.com/fk_datetime.asp

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -