View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
gkelle[_5_] gkelle[_5_] is offline
external usenet poster
 
Posts: 1
Default SQL query to ODBC

I'm using the following query to download to Excel
Error says it doesn't expect the keyword Between in the IIf statement.
Works fine without the IIf.
Any suggestions?
vQuery = "SELECT PSPSP100.PARNT, PSPSP100.CSEQN, PSPSP100.PSPCL,
PSPSP100.CHILD, PSPSP100.PSCCL, MSPMP100.PRDNO, MSPMP100.DESCP,
IIf(PSPSP100.PSPCL Between 'AA'And 'YM',MSPMP100.S2APH='C10301A',
MSPMP100.S2APH Like '*') FROM-----"


---
Message posted from http://www.ExcelForum.com/