473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1241
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

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

Similar topics

1
by: D. Shifflett | last post by:
Hi all, I am having trouble with a program that ran fine on Python 2.0 (#0, Mar 1 2001, 01:47:55) on linux2 but will not work on Python 2.3.2 (#1, Oct 8 2003, 17:33:47) on linux2
2
by: RanDeep | last post by:
I have two nodes that both exist underneath the root node. They are linked, however, in the sense that one of the nodes contains a copy of an id that is used to refer to the other. However, when I...
3
by: Dennis M. Marks | last post by:
I have a problem with the following code. It generates a <FORM><SELECT><OPTION> list. There is no problem in the generating. The problem is in the execution as follows. It works fine in Mac IE...
3
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I...
1
by: Andrew McNab | last post by:
Hi folks, I have a problem with an MS Access SQL query which is being used in an Access Report, and am wondering if anyone can help. Basically, my query (shown below) gets some records from a...
2
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
2
by: areef.islam | last post by:
Hi, I am kinda new to javascript and I am having this problem with selecting multiple options from a select tag. Hope someone can help me out here. here is my code...
3
by: imrantbd | last post by:
This is my first problem.Please help me. I have the following code: <head> <script language="JavaScript"> function addSrcToDestList() { destList1 = window.document.forms.destList; srcList...
13
by: PinkBishop | last post by:
I am using VS 2005 with a formview control trying to insert a record to my access db. The data is submitted to the main table no problem, but I need to carry the catID to the bridge table...
2
by: djnokturnal | last post by:
Hey guys / gals, First time posting and of course I am sure it is something that has been answered 100 times but for some reason I just cant find the answer :) First off here is the structure...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.