469,326 Members | 1,224 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,326 developers. It's quick & easy.

sql select problem

Hi

I have a table with the columns

Id, Date, Downtime, FromDate, ToDate

How the data should look like in the table
33 2007-04-17 00:00:00.000 2 2007-04-17 15:55:52.000 2007-04-17 15:58:17.000
34 2007-04-17 00:00:00.000 68 2007-04-17 15:58:17.000 2007-04-17 17:06:27.000
35 2007-04-17 00:00:00.000 1 2007-04-17 17:06:27.000 2007-04-17 17:06:37.000
36 2007-04-18 00:00:00.000 2 2007-04-18 15:55:52.000 2007-04-18 15:58:17.000
37 2007-04-18 00:00:00.000 68 2007-04-18 15:58:17.000 2007-04-18 17:06:27.000
38 2007-04-19 00:00:00.000 1 2007-04-19 17:06:27.000 2007-04-19 17:06:37.000

I shall generate a report looking like this(Date column should be distinct in a way):

2007-04-17
2 2007-04-17 15:55:52.000 2007-04-17 15:58:17.000
68 2007-04-17 15:58:17.000 2007-04-17 17:06:27.000
0 2007-04-17 17:06:27.000 2007-04-17 17:06:37.000
2007-04-18
2 2007-04-18 15:55:52.000 2007-04-18 15:58:17.000
68 2007-04-18 15:58:17.000 2007-04-18 17:06:27.000
2007-04-19
1 2007-04-19 17:06:27.000 2007-04-19 17:06:37.000

This would been pretty easy in C#, but I need some help to solve this in sql ( the report takes an sql stored function, I’m using sql server 2005). Does anyone know if this is possible in sql?

Thanks for help 
Apr 23 '07 #1
1 1125
I worked it out, I could handle it in the rdl report with groups and hide duplicates

Hi

I have a table with the columns

Id, Date, Downtime, FromDate, ToDate

How the data should look like in the table
33 2007-04-17 00:00:00.000 2 2007-04-17 15:55:52.000 2007-04-17 15:58:17.000
34 2007-04-17 00:00:00.000 68 2007-04-17 15:58:17.000 2007-04-17 17:06:27.000
35 2007-04-17 00:00:00.000 1 2007-04-17 17:06:27.000 2007-04-17 17:06:37.000
36 2007-04-18 00:00:00.000 2 2007-04-18 15:55:52.000 2007-04-18 15:58:17.000
37 2007-04-18 00:00:00.000 68 2007-04-18 15:58:17.000 2007-04-18 17:06:27.000
38 2007-04-19 00:00:00.000 1 2007-04-19 17:06:27.000 2007-04-19 17:06:37.000

I shall generate a report looking like this(Date column should be distinct in a way):

2007-04-17
2 2007-04-17 15:55:52.000 2007-04-17 15:58:17.000
68 2007-04-17 15:58:17.000 2007-04-17 17:06:27.000
0 2007-04-17 17:06:27.000 2007-04-17 17:06:37.000
2007-04-18
2 2007-04-18 15:55:52.000 2007-04-18 15:58:17.000
68 2007-04-18 15:58:17.000 2007-04-18 17:06:27.000
2007-04-19
1 2007-04-19 17:06:27.000 2007-04-19 17:06:37.000

This would been pretty easy in C#, but I need some help to solve this in sql ( the report takes an sql stored function, I’m using sql server 2005). Does anyone know if this is possible in sql?

Thanks for help 
Apr 23 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by D. Shifflett | last post: by
3 posts views Thread by Dennis M. Marks | last post: by
3 posts views Thread by Tcs | last post: by
2 posts views Thread by Chris Plowman | last post: by
2 posts views Thread by areef.islam | last post: by
13 posts views Thread by PinkBishop | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.