| Author |
Topic |
|
ramdas
Posting Yak Master
181 Posts |
Posted - 2003-09-11 : 14:08:02
|
| Hi,I have a table which has description of a problem and a created date colum which is of datetime data type. I need to produce a result with the description and datetime grouped by description and datetime for every half hour with the count. For example:DataDesc CreatedDateabc 08-01-2003 00:15:00def 08-01-2003 00:22:00abc 08-01-2003 00:24:00xyz 08-01-2003 00:35:00ResultDesc CreatedDate Countabc 08-01-2003 00:00:00 2def 08-01-2003 00:00:00 1xyz 08-01-2003 00:30:00 1Ramdas NarayananSQL Server DBA |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-09-11 : 14:16:05
|
| Ramdas, you need to provide the DDL and DML statements in order for us to help. It is much easier for the person needing help to provide this information than for all of us to do it on our own. Please see this thread for what needs to be provided:[url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=29085[/url]Tara |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
|
ramdas
Posting Yak Master
181 Posts |
Posted - 2003-09-11 : 14:51:01
|
| CREATE TABLE [dbo].[Test] ( [EntityId] [char] (10) NOT NULL , [TestId] [int] IDENTITY (1, 1) NOT NULL , [ShortDescription] [varchar] (128) NOT NULL , [CreationDate] [datetime] NOT NULL , [LastModifiedBy] [varchar] (30) NOT NULL , [LastModifiedDate] [datetime] NOT NULL , [NextTestDate] [datetime] NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]GOshortdescription creationdate --------------------------------CSR Guide: Address Change 2003-08-01 00:59:35.997Guide:Change Address, E-mail, Or Phone Numbers 2003-08-01 01:21:46.997Guide:Change Address, E-mail, Or Phone Numbers 2003-08-01 01:23:36.000Lead Times Too Long 2003-08-01 01:28:16.000Lead Times Too Long 2003-08-01 01:28:16.000CSR Guide: Scheduled Transfers 2003-08-01 01:38:02.997CSR Guide: Other Request Fulfillment 2003-08-01 01:40:06.997Guide:Comments or Questions 2003-08-01 02:03:46.000atm/debit 2003-08-01 02:06:00.000Guide:Change Address, E-mail, Or Phone Numbers 2003-08-01 02:28:31.997CSR Guide: Scheduled Transfers 2003-08-01 02:42:13.000The result needs to be the way i had described in my first post.Ramdas NarayananSQL Server DBA |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-09-11 : 14:55:10
|
| I'll get you started on the first couple, then you do the rest:INSERT INTO Test VALUES ('CSR Guide: Address Change','2003-08-01 00:59:35.997')INSERT INTO Test VALUES ('Guide:Change Address, E-mail, Or Phone Numbers','2003-08-01 01:21:46.997')and so on.Seriously, why should anyone here take the time to do this for you? We are happy to help, but help us out !Hopefully you can see that if we can just cut and paste into QA to solve your problem, you will get many more results, they will be much more accurate, and fully tested with whatever data you provide.- Jeff |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-09-11 : 14:55:38
|
| You haven't provided the DML for the sample data. We need INSERT INTO statements for all of the rows. It is much too hard to look at data on a web page. It is much easier to view it in Query Analyzer and play around with it.Tara |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-09-11 : 15:12:24
|
| Should be something on the ASK SQL team page indicating how to ask...Brett8-)SELECT @@POST=NewId()That's correct! It's an AlphaNumeric! |
 |
|
|
ramdas
Posting Yak Master
181 Posts |
Posted - 2003-09-11 : 15:38:52
|
| Hi,I am sorry for all the trouble caused. I found the solution.Will post all details before submitting the post.Thank youRamdas NarayananSQL Server DBA |
 |
|
|
|