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

MySQL Query Syntax vs MSSQL

16
We just converted a database from MySQL 4.1.20 to 5.0 so we can create a view that we may query against. We'd like to use a previous MS Access Query (i.e. MS SQL) to create the View, but are running into syntax errors. I think we've discovered that IIF statements become IF statements, but there are other issues as well. Here is the Access Query. I believe that we also have a problem in the area of "InStr" where we are searching for the character "<" or ">".

Expand|Select|Wrap|Line Numbers
  1. SELECT cdr.calldate AS [Date], cdr.calldate AS [time], IIf(Len([src])=3,"O","I") AS inout, IIf([inout]="O",[Src],[Dst]) AS Station, IIf([inout]="O",[dst],[src]) AS LDN, Mid([clid],2,InStr(3,[clid],"<")-4) AS CallerName, Mid([clid],InStr([clid],"<")+1,[numdig]) AS CallerNum, cdr.duration, cdr.billsec, IIf([channel] Like "zap*",[channel],[dstchannel]) AS trunk, cdr.dcontext, InStr([clid],">")-InStr([clid],"<")-1 AS numdig, cdr.clid
  2. FROM cdr
  3. WHERE (((cdr.billsec)>45) AND ((Left([channel],3) & Left([dstchannel],3)) In ("zapsip","sipzap")) AND ((cdr.disposition)="answered")); 
Any help would be greatly apprciated.
Nov 5 '07 #1
0 1003

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

Similar topics

133
by: jonathan | last post by:
hey all, I realize that this question might pop up from time to time, but I haven't seen it a while and things might of changed, so - Right now (July 2004) how does mysql stand up in...
2
by: James Alexander Starritt | last post by:
I also posted similarly in mailing.database.mysql I have created a rather large (60 table database) website dealio in PHP that works with MS SQL Server, Oracle, MySQL and presumably any other...
9
by: Jacques Lebastard | last post by:
I have a problem writing PHP ODBC scripts that suit both MySQL and PostgreSQL. So far, the following syntaxes seem to apply to each database (this is an 'insert' example; the same differences apply...
1
by: Ike | last post by:
Recently, I began using a different MySQL verver (i.e. different machine as well as different version#, going from 4.12a to 4.1.9 max). The following query used to work: select firstname,...
7
clintw
by: clintw | last post by:
I'm trying to convert a MSSQL select statement to MySQL, but am having difficulty with the following section: ... INNER JOIN tableA ON tableB.field1 = tableA.field1 INNER JOIN tableC ON...
5
by: M. Savas Zorlu | last post by:
Hi, I just decided to leave Mssql and start using Mysql. I am having some problems with my queries; is there anyone here who has a knowledge of query syntax in Mysql? If so, I need some help...
0
by: exclaim | last post by:
Apologies if this is not the right forum. I have an application written originally to work with MySQL which now has to be extended to work with MSSQL also. I have modified all my database calls...
0
by: Gosth in the shell | last post by:
Hi there, i need some help I got a software to backend is MSSQL 2005, but a provider software requires an UPDATE on his table with MySQL 5.0.56a backend, so i made the next: download and...
1
by: nemesisdan | last post by:
This may seem simple to most, but for some reason i cannot get this to work!! I have 2 tables, table_a & table_b Both tables have a string reference number used to join. table_a will only ever...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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:
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.