RSS Forums RSS

Get last month from timestamp

Please support our MS SQL advertiser: Programming Forums
Thread Solved
Reply
Posts: 305
Reputation: freshfitz is an unknown quantity at this point 
Solved Threads: 23
freshfitz freshfitz is offline Offline
Posting Whiz

Get last month from timestamp

  #1  
Jan 1st, 2009
How would I select everything from last month in a sql statment my cell has a time stamp in it

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.
AddThis Social Bookmark Button
Reply With Quote  
Posts: 1,867
Reputation: Ramy Mahrous has a spectacular aura about Ramy Mahrous has a spectacular aura about 
Solved Threads: 214
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Posting Virtuoso

Re: Get last month from timestamp

  #2  
Jan 1st, 2009
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?
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote  
Posts: 305
Reputation: freshfitz is an unknown quantity at this point 
Solved Threads: 23
freshfitz freshfitz is offline Offline
Posting Whiz

Re: Get last month from timestamp

  #3  
Jan 1st, 2009
I want to display all the orders from last month so

  1. SELECT *
  2. FROM Get_estimates
  3. 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.
Reply With Quote  
Posts: 1,867
Reputation: Ramy Mahrous has a spectacular aura about Ramy Mahrous has a spectacular aura about 
Solved Threads: 214
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Posting Virtuoso

Re: Get last month from timestamp

  #4  
Jan 1st, 2009
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
Reply With Quote  
Posts: 305
Reputation: freshfitz is an unknown quantity at this point 
Solved Threads: 23
freshfitz freshfitz is offline Offline
Posting Whiz

Re: Get last month from timestamp

  #5  
Jan 1st, 2009
I got it thanks
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 1636 | Replies: 4 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:33 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC