Solved

How to convert this MySQL Query to SQL Server Query?

Posted on 2012-03-20
1
430 Views
Last Modified: 2012-06-21
Hi,

I would like to know how to convert this MySQL Server Query:

SELECT * FROM [i]table[/i] WHERE [i]column[/i] BETWEEN DATE_SUB(curdate(), INTERVAL 8 WEEK) AND CURDATE() ORDER BY views DESC

Open in new window


To a SQL Server Query?

Thank you
0
Comment
Question by:marcoloppo
1 Comment
 
LVL 11

Accepted Solution

by:
dougaug earned 500 total points
ID: 37745617
select * from table where column between dateadd(ww, -8, getdate()) and getdate()
order by views DESC
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Full Text Search string 5 33
Need Counts 11 42
How to query date ranges with SQL 6 24
Left Join with Tuple returning more rows 10 56
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

758 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

21 Experts available now in Live!

Get 1:1 Help Now