I have the following query that works fine in MS Access, MySQL and SQL Server but when I try to use it in SQLite I get an error:
near "(": syntax error:
I can't find the Left command in any documentation of SQLite so I guess it isn't there but how could I get it to work then.
SELECT
Left(fldcall, 3) AS Group1,
Mid(fldcall, 4, 1) AS Group2,
tblcalls.*,
tblzip.fldcity
FROM
tblcalls
LEFT JOIN
tblzip ON tblcalls.fldzipcode = tblzip.fldzipcode;
You can use the substr() function instead:
SELECT substr(fldcall, 1, 3) AS Group1,
substr(fldcall, 4, 1) AS Group2,
tblcalls.*,
tblzip.fldcity
FROM tblcalls
LEFT JOIN tblzip USING (fldzipcode);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With