Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid Coulmn Name "colname" in MS-SQL & PB

Status
Not open for further replies.

vulcanjena

Programmer
May 22, 2003
39
PR
PB8.0 and MSSQL server 8.0 ,
I'm getting error : Invalid Coulmn Name "colname"
where as the same script is running Ok in Query Analyser in
MS-Sql.
Do anybody have any idea /solution ?

Thanks in advance !

 
SELECT PERSON.PERSONNUM,
BADGEASSIGN.BADGENUM,
VP_HOMELABORACCT.LABORLEVELNAME1,
VP_HOMELABORACCT.LABORLEVELNAME2,
VP_HOMELABORACCT.LABORLEVELNAME4,
ISC_PAYCODECONFIG.SHIFT_CODE,
sum(WFCTOTAL.DURATIONSECSQTY )/3600.00 as TotalWorkedHours,
ISC_PAYCODECONFIG.MONEYCODE,
sum(WFCTOTAL.MONEYAMT) as MoneyAmt,
WFCTOTAL.APPLYDTM,
sum(WFCTOTAL.DURATIONSECSQTY )/3600.00 as TotalWorkedHours,
ISC_PAYCODECONFIG.FLAG
FROM ISC_PAYCODECONFIG,
PERSON,
WFCTOTAL,
WTKEMPLOYEE,
VP_HOMELABORACCT,
BADGEASSIGN
WHERE ( ISC_PAYCODECONFIG.PAYCODEID = WFCTOTAL.PAYCODEID ) and
( WTKEMPLOYEE.EMPLOYEEID = WFCTOTAL.EMPLOYEEID ) and
( WTKEMPLOYEE.PERSONID = PERSON.PERSONID ) and
( BADGEASSIGN.PERSONID = PERSON.PERSONID ) and
( WTKEMPLOYEE.EMPLOYEEID = VP_HOMELABORACCT.EMPLOYEEID ) and ( ISC_PAYCODECONFIG.SHIFT_CODE <> ' ') AND
( WFCTOTAL.DURATIONSECSQTY <> 0 ) AND
( PERSON.PERSONID in ( :arg_emp ) ) AND
(( WFCTOTAL.APPLYDTM >= :arg_from ) AND
( WFCTOTAL.APPLYDTM <= :arg_to ))
GROUP BY PERSON.PERSONNUM,
BADGEASSIGN.BADGENUM,
VP_HOMELABORACCT.LABORLEVELNAME1,
VP_HOMELABORACCT.LABORLEVELNAME2,
VP_HOMELABORACCT.LABORLEVELNAME4,
ISC_PAYCODECONFIG.PAYCODEID,
ISC_PAYCODECONFIG.DESCRIPTION,
ISC_PAYCODECONFIG.MONEYCODE,
WFCTOTAL.APPLYDTM,
ISC_PAYCODECONFIG.SHIFT_CODE,
ISC_PAYCODECONFIG.FLAG


The above SQL is working fine , but when I'm changing
( WFCTOTAL.DURATIONSECSQTY <> 0 ) to ( WFCTOTAL.DURATIONSECSQTY = 0 ) in where clause it is showing error . And the error is invalid colname &quot;SHIFT_CODE&quot; . Where as the spelling and the db connection everything is OK.
 
try running this SQL in SQLAdvantage / Query Analyser.
BTW uncheck &quot;Optimise statement for prepare&quot; option in the database profile
 
It is running perfectly OK in Query analyser , only difference is I'm putting the values in arguments.

thanx
 
i see that :arg_emp is a string array. are u passing in the correct values?
 
yep, no problem , even the whole thing is working perfect ,
I'm getting error message when I'm trying to change this
&quot; ( WFCTOTAL.DURATIONSECSQTY <> 0 ) AND &quot; to

( WFCTOTAL.DURATIONSECSQTY >= 0 ) AND or
( WFCTOTAL.DURATIONSECSQTY = 0 ) AND or
( WFCTOTAL.DURATIONSECSQTY > 0 ) AND .

Anyway I found another way of doing it.

Thanks for your suggestions.
vulcanjena


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top