Solved

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

Posted on 2007-11-16
7
1,608 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to count in a table in php 22 34
SQL Server Count where two id types exist in column 8 27
mysql date time 14 28
What's wrong with this T-SQL Foreign Key? 7 41
If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Creating and Managing Databases with phpMyAdmin in cPanel.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

786 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