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
 General SQL Server Forums
 New to SQL Server Programming
 prompt user for data

Author  Topic 

kathyc2003
Starting Member

15 Posts

Posted - 2006-10-20 : 16:18:27
I need to prompt a user for start and end dates as well
as start and end times using a specific format for the
date and time.

I am having difficulty constructing the query.

So far I have...

DECLARE @StartDate DATETIME
DECLARE @EndDate DATETIME
DECLARE @StartTime DATETIME
DECLARE @EndTime DATETIME

SELECT I.IncidentId,
I.CFScompanyname,
I.New_created_time,
E.createdon

FROM dbo.IncidentExtensionBase I
INNER JOIN dbo.IncidentBase E on I.IncidentId = E.IncidentId

WHERE E.createdon >= @StartDate AND
E.createdon <= @EndDate AND
E.createdon >= @StartTime AND
E.createdon <= @EndTime;

Could someone please let me know how I prompt the user for this data.

Thank you very much.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-10-20 : 16:26:08
You can't prompt a user for data inside T-SQL (SQL Server). You need to do this in your application.

Tara Kizer
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-10-21 : 00:32:52
>>Could someone please let me know how I prompt the user for this data.

Thats what the front end is for.
Do it in front end application.

Madhivanan

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

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-10-21 : 08:01:16
> Do it in front end application.

ROTFL.
this one keeps getting funnier and funnier




Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-10-21 : 08:03:14
>>this one keeps getting funnier and funnier

Because newbies want to do all in sql

Madhivanan

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

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-10-22 : 01:35:35
I don't think that's what Mladen is referring to...he's got a different connotation in mind.

Tara Kizer
Go to Top of Page
   

- Advertisement -