[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

convert access 2007 sql to sql 2008

Posted on 2012-08-24
1
Medium Priority
?
568 Views
Last Modified: 2012-08-25
I need help re-writing this access 2007 sql query to sql 2008 syntax.

File is attached.
test.txt
0
Comment
Question by:Danean
1 Comment
 
LVL 17

Accepted Solution

by:
ramrom earned 2000 total points
ID: 38331331
Changes for readability:
- reformatted into several lines
- used table aliases
- removed all unnecessary () and []

Since I don't have SQL Server to test this on here is my best guess for the other changes:
- " to '
- date constant following http://msdn.microsoft.com/en-us/library/ms180878%28v=sql.105%29.aspx#StringLiteralDateandTimeFormats
UPDATE CLAIMVIEW AS V
LEFT JOIN P AS P
ON V.SSNO = P.SSNO 
AND V.COMPANY = P.COMPANY 

SET P.COMPANY = V.COMPANY, 
P.SSNO = V.SSNO, 
P.PROBLEM = V.DIAGNOSIS, 
P.REPORTED = V.ENTRYDATE, 
P.STARTDATE = V.ENTRYDATE, 
P.ICD9 = V.ICD9, 
P.RANK = '1', 
P.ENDDATE = '1900-1-1T00:00:00', 
P.PROVIDER = 'MEDINFO', 
P.PROV = 'MEDINFO', 
P.ACCIDENT = 'N', 
P.ENTRYDATE = V.ENTRYDATE

WHERE V.XACDATE > '2011-10-07T00:00:00' 
And V.XACDATE < '2012-08-2407T00:00:00';

Open in new window

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

834 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