Get last month from timestamp
Please support our MS SQL advertiser: Programming Forums
Thread Solved
![]() |
•
•
Posts: 305
Reputation:
Solved Threads: 23
How would I select everything from last month in a sql statment my cell has a time stamp in it
Ouput
[DateTimeStamp]
2008-02-28 11:39:35.247
2008-03-09 13:15:12.513
2008-03-09 13:16:53.700
2008-03-26 13:30:20.077
2008-03-26 13:30:51.810
SELECT DateTimeStamp from Get_estimates
Ouput
[DateTimeStamp]
2008-02-28 11:39:35.247
2008-03-09 13:15:12.513
2008-03-09 13:16:53.700
2008-03-26 13:30:20.077
2008-03-26 13:30:51.810
Last edited by freshfitz : Jan 1st, 2009 at 2:50 pm.
So the output should be
2008-03-09 13:15:12.513
2008-03-09 13:16:53.700
2008-03-26 13:30:20.077
2008-03-26 13:30:51.810
right?
2008-03-09 13:15:12.513
2008-03-09 13:16:53.700
2008-03-26 13:30:20.077
2008-03-26 13:30:51.810
right?
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
•
•
Posts: 305
Reputation:
Solved Threads: 23
I want to display all the orders from last month so
sql Syntax (Toggle Plain Text)
SELECT * FROM Get_estimates WHERE DateTimeStamp = [lastmonth]
Last edited by peter_budo : Jan 6th, 2009 at 8:21 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Ok, please give me sample Data and your desired output
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
Other Threads in the MS SQL Forum
- problem with date validation (JavaScript / DHTML / AJAX)
- REg: timestamp with milliseconds linux c++ (C++)
- expired date validation and session (PHP)
- Time Stamp Help (PHP)
- Data Base error (MySQL)
- php mysql question (PHP)
- FireWall Back ups with Expect (Shell Scripting)
- capturing line from script output and appending to a file (Shell Scripting)
- C# calling parameterized Oracle storage procedure ? (C#)
- ugh! One Page, 2 re-loads (page request i guess) (PHP)
Other Threads in the MS SQL Forum
- Previous Thread: Crazy CrossTab problems
- Next Thread: SQL Server 2005 - Merge Replication
•
•
•
•
Views: 1636 | Replies: 4 | Currently Viewing: 1 (0 members and 1 guests)






Linear Mode