Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

How do I get data from a certain date range?

I wrote it like this but it errors out.

select * from ORDER_PROC where ORDERING_DATE is > than 2010-09-01
0
Becky Edwards
Asked:
Becky Edwards
  • 3
1 Solution
 
Rajkumar GsSoftware EngineerCommented:
Did you try this way ?
select * from ORDER_PROC where ORDERING_DATE  > '2010-09-01' 
select * from ORDER_PROC where ORDERING_DATE  > '09/01/2010'

Open in new window

0
 
Rajkumar GsSoftware EngineerCommented:
Another way
select * from ORDER_PROC 
where DATEDIFF(minute ,  '09/01/2011', ORDERING_DATE) > 0

Open in new window

0
 
sachinpatil10dCommented:
convert to datetime

select * from ORDER_PROC where ORDERING_DATE is > than convert(datetime,'2010-09-01')

Open in new window

0
 
Becky EdwardsEpic Clarity DeveloperAuthor Commented:
Thank You!  That worked perfectly.
0
 
Rajkumar GsSoftware EngineerCommented:
My pleasure!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now