This is the SQL query I wrote in MS Access 07:
IF EXISTS (Select * FROM MyTable) print 'Yes' else print 'No'
This is the error it’s giving me when i run the query:
“Invalid SQL Statemenet; Expected DELETE, INSERT, PROCEDURE, SELECT, UPDATE”
The query is correct, as far as I know, I think it’s from Access, can anyone help me please? Thanks
A few points:
iif(), notIFAccess SQL doesn’t use EXISTSEdit:
Actually it does work, even though I couldn’t find it in the help files. This works fine:
Select (IIf(Exists (SELECT 1 FROM [Table1]),'Y','N')) as A from [Table1];/Edit
iif(
DCount("AnyFieldName","TableName")>0,
"Yes",
"No"
http://www.techonthenet.com/access/functions/