?
Solved

How to convert this MySQL Query to SQL Server Query?

Posted on 2012-03-20
1
Medium Priority
?
440 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 11

Accepted Solution

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

Featured Post

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
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.

770 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