15,922,166 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 12168418 (Top 7 by date)
Member 12168418
14-Dec-15 4:05am
View
Hi CHill60,
Thanks for your valuble answer it is working
Member 12168418
10-Dec-15 6:12am
View
select CAST(dateadd(S,Submit_Date+'19800','19700101') as DATE) as 'Date', CAST(DATEPART(HOUR, dateadd(S,Submit_Date+'19800','19700101')) as varchar)+ ':00' as 'Hour' ,
count(1) as Count , char_Circle='andhar pradesh' from HPD_Help_Desk where Submitter = 'temip_admin' and dateadd(s,Submit_Date+'19800','19700101') >CONVERT (date, SYSDATETIME())
and char_Circle='andhra pradesh' group by CAST(dateadd(S,Submit_Date+'19800','19700101') as DATE), DATEPART(HOUR,dateadd(S,Submit_Date+'19800','19700101')) order by Hour asc
the above query output is as below
Date Hour Count char_Circle
09/12/2015 00:00 13 chennai
09/12/2015 01:00 19 chennai
09/12/2015 10:00 42 chennai
09/12/2015 11:00 52 chennai
09/12/2015 12:00 64 chennai
09/12/2015 13:00 85 chennai
09/12/2015 14:00 88 chennai
09/12/2015 15:00 195 chennai
09/12/2015 16:00 148 chennai
09/12/2015 17:00 112 chennai
09/12/2015 18:00 118 chennai
09/12/2015 19:00 39 chennai
09/12/2015 02:00 49 chennai
09/12/2015 20:00 150 chennai
09/12/2015 21:00 50 chennai
09/12/2015 22:00 72 chennai
09/12/2015 23:00 41 chennai
09/12/2015 03:00 5 chennai
09/12/2015 04:00 16 chennai
09/12/2015 05:00 106 chennai
09/12/2015 06:00 11 chennai
09/12/2015 07:00 4 chennai
09/12/2015 08:00 40 chennai
09/12/2015 09:00 70 chennai
How can i get above output as a horizontal output
Member 12168418
30-Nov-15 6:05am
View
Hi,
I just want to know process and we have Peer to Peer Replication betweent two Databases.
Member 12168418
27-Nov-15 2:36am
View
Hi Pankaj,
Thanks for your help it is working thanks alot...
Member 12168418
27-Nov-15 2:20am
View
Error like
Msg 102, Level 15, State 1, Line 7
Incorrect syntax near '19800'.
Member 12168418
27-Nov-15 2:10am
View
still it is not working i am not sql query backgroung please help me
Member 12168418
26-Nov-15 7:43am
View
Hi Bhagyesh,
datatype Int for Create_date
query is getting output as below
Create_date count
2015-11-01 27513
2015-11-02 29546
2015-11-03 31742
2015-11-04 28510
2015-11-05 34850
2015-11-06 33436
2015-11-07 31145
2015-11-08 27907
But when iam tring to exec as below it is getting error
@query = 'select CAST(dateadd(s,Create_date+'19800','19700101') as Date) as 'Create_date', count(1) as count from TechM_Indus_LogDeliverSMS where char_TicketNumber__c like 'INCN%' and dateadd(s,Create_date+'19800','19700101')
>='11/01/2015 12:00:00 AM' and dateadd(s,Create_date+'19800','19700101') <= '11/30/2015 23:59:00 PM'
group by CAST(dateadd(S,Create_date+'19800','19700101') as Date) order by Create_date asc'
Show More