Solved

MySql Equivenlt of dbo.cart.Creation_Date > GETDATE() - 3

Posted on 2007-11-16
7
1,602 Views
Last Modified: 2008-02-21
Hi,

In SQL Server I can write a query which will return all records x amount of days from today date using the code below.

dbo.cart.Creation_Date > GETDATE() - 3

Is the an equivenlt in MySQL?
0
Comment
Question by:BenthamLtd
7 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 20302724
0
 

Author Comment

by:BenthamLtd
ID: 20302734
Hi,

I tried that, But I cant get it to do - 3 days
0
 
LVL 61

Accepted Solution

by:
mbizup earned 63 total points
ID: 20302792
Try using DateAdd instead of simply subtracting three days:

DATE_ADD(NOW(), INTERVAL -3 DAY)
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 25

Expert Comment

by:imitchie
ID: 20304029
dbo.cart.Creation_Date > DATESUB(NOW, INTERVAL 3 DAY)
0
 
LVL 25

Assisted Solution

by:imitchie
imitchie earned 62 total points
ID: 20304030
dbo.cart.Creation_Date > DATESUB(NOW(), INTERVAL 3 DAY)
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20953233
Forced accept.

Computer101
Community Support Moderator
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

17 Experts available now in Live!

Get 1:1 Help Now