Solved

sql server - select a value from specific date

Posted on 2013-01-21
1
321 Views
Last Modified: 2013-01-21
Hi

Im wanting to do a select query that selects a value from a table where its created date is in the last 72 hours.

Thanks
0
Comment
Question by:razza_b
1 Comment
 
LVL 8

Accepted Solution

by:
virtuadept earned 500 total points
Comment Utility
SELECT col1, col2, col3...
FROM table
WHERE create_date_column >= DATEADD(HOUR,-72,getdate())

Could be more helpful if you post the table definition.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now