473,386 Members | 1,602 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,386 software developers and data experts.

Convert Access quey to SQL statement

How to convert following MS access quey to SQL server statement

ACCESS:
Testx: IIf(Mid(dbo_ITMaster!City,1,2)="AB",IIf(Mid(dbo_IT Master!Plan,1,3)<>"XYZ","M",IIf(dbo_ITMaster!Cente r="1111", "A", IIf(dbo_ITMaster!Center="2222","C",IIf(dbo_ITMaste r!Center="3333",IIf(dbo_ITMaster!Zip=23456,"A","B" ),IIf(dbo_ITMaster!Sop="ABC","Z"," "))))))



MY SQL STATEMENT:
Testx = CASE
WHEN SUBSTRING([ITMaster].[Section],1,2) = 'AB' AND
SUBSTRING([ITMaster].[MastPlanFam],1,3)<>'XYZ' THEN 'M'
WHEN [ITMaster].[center] = '1111' THEN 'A'
WHEN [ITMaster].[center] = '2222' THEN 'C'
WHEN [ITMaster].[center] = '3333' AND
[ITMaster].[Vendor] = 23456 THEN 'A' ELSE 'B'
WHEN [ITMaster].[Sop] = 'ABC' THEN 'Z' ELSE '' END

UP TO HERE IT WI WORKING FINE
Aug 14 '08 #1
1 1570
ck9663
2,878 Expert 2GB
Looks like you have 2 "ELSE"

-- CK
Aug 14 '08 #2

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

Similar topics

1
by: ian m via SQLMonster.com | last post by:
Hi, I currently have a ms access update query that runs perfectly well and quicly in access however I now need to add this query to convert this qeryu to oracles equivelant sql syntax and add it...
29
by: Mark B | last post by:
We have an Access app (quite big) at www.orbisoft.com/download. We have had requests by potential users to have it converted to an SQL version for them since there corporate policy excludes them...
25
by: cory | last post by:
Hi, I have an Access database and am having an ASP.NEt application written for it. It is almost complete. I have a hosting company that I signed up with a month ago but before I did anything I...
2
by: Annie D via AccessMonster.com | last post by:
Hi, I am using the following SQL statement courtesy of access monster user: 'Terry Kreft ' to convert dates from a text format (20020331 00:00:00) to a recognised date/time format (31/03/2002)....
1
by: Corey | last post by:
Hello everyone Can anyone help me convert the sql statement below to a statement I can put into Microsoft access, or help me brake this down so I can put it into access. Thanks Corey ...
7
by: groups | last post by:
This is my first foray into writing a generic method and maybe I've bitten off more than I can chew. My intent is to have a generic method that accepts a value name and that value will be...
3
by: clarencemo | last post by:
Hello all, I have a append query that works great if I just run the query via Access. I need to convert that query into VBA code. Here is the SQL View of the query I'm trying to convert: ...
0
by: sebastiany | last post by:
Hi, I currently have a MS Access select query (pretty lengthy) that runs fine in MS Access, however I now need to convert this query to Oracle's equivelant SQL syntax so that I can create a SQL...
2
by: akshaycjoshi | last post by:
Hi, I am developing one application which requires me to compare date.The dataabse being MS access 2003. When i execute the query in c# it does not show any record ,the date although matches with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.