Hi,
A function receives a table name and a where condition and is supposed to count the records that meet the condition in a Sql server database.
(calling function)
lc = has desired value for fieldname
n = MyCount([tablename],[fieldname = "] + lc + ["])
FUNCTION MyCount
LPARAMETERS tcTable,tcCondition
...
jc = [SELECT COUNT(*) AS c FROM dbo.] + tcTable + [ ] + tcTable ;
+ IIF(EMPTY(tcCondition),[],[ WHERE ]+ tcCondition)
lnRetVal = SQLEXEC(lnHandle,jc)
...
Problem is lnRetVal = -1 because of tcCondition. If tcCondition were blank, no problem.
Any ideas? TIA,
Alex
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement