473,385 Members | 1,311 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

converting access 2007 update query to sql server 2005 update query

I ran this code on my access 07 db and it updates a number of records 61,425, I try and run the query in SQL Server 2005 modifying the IIf to CASE WHEN and I get a number of sytax errors.

Original code

UPDATE tblShipments
SET tblShipments.[Order Type] = IIf([EDI TP Id] Like "web*","WEB",
IIf([FrctStndRte 1/0]=1,"EDI",IIf([EDI TP Id] Is Null,"MAN","EDI")));

Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'Like'.

I got that when I compiled it and it won't execute. Any suggestions on how I should modify the code to get the fields FrctStndRte 1/0 and EDI TP Id to update.
Aug 31 '09 #1
3 4026
ck9663
2,878 Expert 2GB
Could you post the SQL Server version of your code?

--- CK
Aug 31 '09 #2
UPDATE tblShipments
SET tblShipments.[Order Type] = IIf([EDI TP Id] Like "web*","WEB",
IIf([FrctStndRte 1/0]=1,"EDI",IIf([EDI TP Id] Is Null,"MAN","EDI")));
Sep 1 '09 #3
ck9663
2,878 Expert 2GB
SQL Server does not have IIF. Use CASE..WHEN instead.

Search the syntax in BOL.

Good luck!!

--- CK
Sep 1 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: ralph_noble | last post by:
Can someome please advise what the equivalent query would be in Microsoft SQL Server ... I've tried a number of combinations with no success ... Thanks, Ralph Noble (ralph_noble@hotmail.com) ...
55
by: AnandaSim | last post by:
I just had a google through this NG but have not seen mention of Erik Rucker's blog entry and the new Jet: http://blogs.msdn.com/access/archive/2005/10/05/477549.aspx mentioned by Mike...
2
by: ILCSP | last post by:
Hello, I have the following query in Access 2000 that I need to convert to SQL 2000: UPDATE tblShoes, tblBoxes SET tblShoes.Laces1 = Null WHERE (((tblShoes.ShoesID)=Int(.)) AND...
7
by: Stephen Martinelli | last post by:
Can anyone tell me why this statement works with sql server with VB.net but crashes when run against a access mdb?....What do I need to change here guys? Update tblInvoice set ar_totalPaid =...
27
by: SQL Learner | last post by:
Hi all, I have an Access db with two large tables - 3,100,000 (tblA) and 7,000 (tblB) records. I created a select query using Inner Join by partial matching two fields (X from tblA and Y from...
5
by: bubbles | last post by:
I am developing an Access 2003 frontend for SQL Server 2005. Problem: Access 2003 cannot update tables in SQL Server 2005 (but can update SQL Server 2000 tables) Is there a patch for Access...
18
by: smckibbe01 | last post by:
I have Pivot Table query in MS Access that I would like to run in SQL Server 2005. Can anyone help me to convert the syntax over to SQL Server. The following is the query in MS Access: ...
10
by: Anthony97 | last post by:
This is a problem I've been fighting through for the last month. I've been tasked with converting access 2007 queries to SQL Server 2005. I have been able to convert a number of queries associated...
1
by: jrod11 | last post by:
Hi everyone, I am currently working on a project that pulls data from sql and displays it in an html file. This is working fine, but I am trying to make it a little more fancy using this cool source...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.