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.
Author |
Topic |
sprotson
Yak Posting Veteran
75 Posts |
Posted - 2013-01-14 : 05:17:36
|
I have a report that retrieves data from a stored procedure based on startdate (ie datetime format).In the report I need to allow the user to choose two parameters, date and time.Date is in datetime format and time is a string.How do I combine these in SSRS to pass back to the stored procedure as datetime? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-01-14 : 05:43:29
|
whats the format in which user enters time? as hh:mi:ss?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
sprotson
Yak Posting Veteran
75 Posts |
Posted - 2013-01-14 : 05:51:26
|
it is hh:mm formatI think I have managed to get it, but need to test against sample date.I think it is - =cdate(Parameters!StartDate.Value & " " & Parameters!StartTime.Value) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
sprotson
Yak Posting Veteran
75 Posts |
Posted - 2013-01-14 : 06:04:11
|
Thanks, will look into that.On another topic, is there a way to generate available values using an SQL query for a string of times?00:0000:0500:10etcI don't fancy having to type in 24hrs of 5 minute intervals |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-01-14 : 06:34:12
|
quote: Originally posted by sprotson Thanks, will look into that.On another topic, is there a way to generate available values using an SQL query for a string of times?00:0000:0500:10etcI don't fancy having to type in 24hrs of 5 minute intervals
yes there'ssee;With CTE(N)AS(SELECT 5UNION ALLSELECT N+5FROM CTEWHERE N+5<24*60)SELECT CONVERT(varchar(8),DATEADD(minute,N,0) ,108)FROM CTEOPTION (MAXRECURSION 0)output------------------------------00:05:0000:10:0000:15:0000:20:0000:25:0000:30:0000:35:0000:40:0000:45:0000:50:0000:55:0001:00:0001:05:0001:10:0001:15:0001:20:0001:25:0001:30:0001:35:0001:40:0001:45:0001:50:0001:55:0002:00:0002:05:0002:10:0002:15:0002:20:0002:25:0002:30:0002:35:0002:40:0002:45:0002:50:0002:55:0003:00:0003:05:0003:10:0003:15:0003:20:0003:25:0003:30:0003:35:0003:40:0003:45:0003:50:0003:55:0004:00:0004:05:0004:10:0004:15:0004:20:0004:25:0004:30:0004:35:0004:40:0004:45:0004:50:0004:55:0005:00:0005:05:0005:10:0005:15:0005:20:0005:25:0005:30:0005:35:0005:40:0005:45:0005:50:0005:55:0006:00:0006:05:0006:10:0006:15:0006:20:0006:25:0006:30:0006:35:0006:40:0006:45:0006:50:0006:55:0007:00:0007:05:0007:10:0007:15:0007:20:0007:25:0007:30:0007:35:0007:40:0007:45:0007:50:0007:55:0008:00:0008:05:0008:10:0008:15:0008:20:0008:25:0008:30:0008:35:0008:40:0008:45:0008:50:0008:55:0009:00:0009:05:0009:10:0009:15:0009:20:0009:25:0009:30:0009:35:0009:40:0009:45:0009:50:0009:55:0010:00:0010:05:0010:10:0010:15:0010:20:0010:25:0010:30:0010:35:0010:40:0010:45:0010:50:0010:55:0011:00:0011:05:0011:10:0011:15:0011:20:0011:25:0011:30:0011:35:0011:40:0011:45:0011:50:0011:55:0012:00:0012:05:0012:10:0012:15:0012:20:0012:25:0012:30:0012:35:0012:40:0012:45:0012:50:0012:55:0013:00:0013:05:0013:10:0013:15:0013:20:0013:25:0013:30:0013:35:0013:40:0013:45:0013:50:0013:55:0014:00:0014:05:0014:10:0014:15:0014:20:0014:25:0014:30:0014:35:0014:40:0014:45:0014:50:0014:55:0015:00:0015:05:0015:10:0015:15:0015:20:0015:25:0015:30:0015:35:0015:40:0015:45:0015:50:0015:55:0016:00:0016:05:0016:10:0016:15:0016:20:0016:25:0016:30:0016:35:0016:40:0016:45:0016:50:0016:55:0017:00:0017:05:0017:10:0017:15:0017:20:0017:25:0017:30:0017:35:0017:40:0017:45:0017:50:0017:55:0018:00:0018:05:0018:10:0018:15:0018:20:0018:25:0018:30:0018:35:0018:40:0018:45:0018:50:0018:55:0019:00:0019:05:0019:10:0019:15:0019:20:0019:25:0019:30:0019:35:0019:40:0019:45:0019:50:0019:55:0020:00:0020:05:0020:10:0020:15:0020:20:0020:25:0020:30:0020:35:0020:40:0020:45:0020:50:0020:55:0021:00:0021:05:0021:10:0021:15:0021:20:0021:25:0021:30:0021:35:0021:40:0021:45:0021:50:0021:55:0022:00:0022:05:0022:10:0022:15:0022:20:0022:25:0022:30:0022:35:0022:40:0022:45:0022:50:0022:55:0023:00:0023:05:0023:10:0023:15:0023:20:0023:25:0023:30:0023:35:0023:40:0023:45:0023:50:0023:55:00 ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
sprotson
Yak Posting Veteran
75 Posts |
Posted - 2013-01-14 : 07:01:39
|
Thanks |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-01-14 : 08:38:36
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|
|
|