[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] (no subject)



Also you have commas after column names there should be no commas.

VMANA.AD_ACCOUNT_TREENOD        &VMANA.AD_ACCOUNT_TREENOD
SUM(VMANA.POSTED_TOTAL_AMT)     &VMANA.POSTED_AMOUNT_AM
 
 
 

-----Original Message-----
From: sqr-users-bounces+angelika_scheffera=msn.com@sqrug.org
[mailto:sqr-users-bounces+angelika_scheffera=msn.com@sqrug.org] On Behalf Of
Kaz.Narayanan@averydennison.com
Sent: Tuesday, April 17, 2007 5:05 PM
To: Shashidhar Rao A
Cc: sqr-users@sqrug.org
Subject: Re: [sqr-users] (no subject)

Sashi,
Thanks for the correction. After placing the SQL, It is working. However, 
this line of SQL is still erroring out.. Could you please help?

BEGIN-SELECT
VMANA.AD_ACCOUNT_TREENOD,       &VMANA.AD_ACCOUNT_TREENOD,
SUM(VMANA.POSTED_TOTAL_AMT)     &VMANA.POSTED_AMOUNT_AM



        LET $THE_NODE = &VMANA.AD_ACCOUNT_TREENOD
        LET $POSTED_AMOUNT_AM = &VMANA.POSTED_AMOUNT_AM
        LET #POSTED_AMOUNT_AM = TO_NUMBER($POSTED_AMOUNT_AM)
        LET #ROUND_NBR    = EDIT((#POSTED_AMOUNT_AM/1000),'0000000000') 
        LET #SELECT_TOTAL = #SELECT_TOTAL +  #POSTED_AMOUNT_AM 
        LET #SELECT_ROUND = #SELECT_ROUND + #ROUND_NBR



FROM PS_AD_ADGLI003_WRK  VMANA
WHERE   VMANA.OPRID       =  $PRCS_OPRID
        AND VMANA.SEQ_NBR < 999999999 
        AND VMANA.RUN_CNTL_ID  = $PRCS_RUN_CNTL_ID
        AND VMANA.AD_PRODUCT_TREENOD = $REC_ENTITY
        AND 
SUBSTRING(VMANA.AD_ACCOUNT_TREENOD,1,LEN(VMANA.AD_ACCOUNT_TREENOD-1 )) IN 
('LNDOWN','LNDIMP','BLDOWN','BLDLSE','MCHOWN','MCHLSE','LSEIMP','CIP','CRPFA
') 

        VMANA.PERIOD = 0 
 
GROUP BY VMANA.AD_ACCOUNT_TREENOD
END-SELECT


K.M.Narayanan
AVERY DENNISON
Corporate IT & Services
(702) 968-5727 -  Work
(702) 332-7118  -  Cell




Shashidhar Rao A <shdhra@yahoo.com>
04/17/2007 02:41 PM
 
        To:     Kaz.Narayanan@averydennison.com
        cc: 
        Subject:        Re: [sqr-users] (no subject)


Place the order by and group by clauses in the first column and
also try to check the values of $AND-CLAUSE and $IN_YEAR variables.
 
Regards,
shashi

Kaz.Narayanan@averydennison.com wrote:
Hello,

I posted this message yesterday.
Could some one help em here?

Thanks
Regards
KM Narayanan

Hello,

I am doing a select in an SQR where we use SQL server.
My codes is as follows:

BEGIN-SELECT
A.PRODUCT 
A.ACCOUNT 
A.DEPTID 
SUM(A.POSTED_TOTAL_AMT) &MAIN_POSTED_TOTAL_AMT

FROM PS_LEDGER A, PS_BUS_UNIT_TBL_GL A1
WHERE A.LEDGER IN ('ACTUALS','MGMT_ADJMT')
[$AND-CLAUSE]
AND A.FISCAL_YEAR = $IN_YEAR
AND A.ACCOUNTING_PERIOD [$WHERE_PERIOD] 
AND A.PRODUCT <> ' '
AND A.ACCOUNT <> ' '
AND A.BUSINESS_UNIT = A1.BUSINESS_UNIT
AND ((A.CURRENCY_CD = ' ' AND A.ACCOUNT LIKE '0%') 
OR (A.CURRENCY_CD = A1.BASE_CURRENCY)) 
GROUP BY A.PRODUCT,A.ACCOUNT,A.DEPTID 
ORDER BY A.PRODUCT,A.ACCOUNT,A.DEPTID 
END-SELECT



I get the following error when I try to execute....
SQR 5528) ODBC SQL dbftch error 3926 in cursor 30: [Microsoft][SQL Native 
Client][SQL Server]The transaction active in this session has been 
committed or aborted by another session. (SQR 5528) ODBC SQL dbftch error 
3971 in cursor 30: [Microsoft][SQL Native Client][SQL Server]Server failed 


to resume the transaction, desc: 7a00000004. Error on line 394: (SQR 3725) 


Bad return fetching row from database. 


I execute the same SQL in Microsoft SQL server studio, It works fine....
Can Someone help me?
Regards

K.M.Narayanan



- -----------------------------------------------------------------
The information transmitted is intended only for the person or entity to 
which it is addressed and may contain confidential and/or privileged 
material. Any review, retransmission, dissemination or other use of, or 
taking of any action in reliance upon, this information by persons or 
entities other than the intended recipient is prohibited. If you received 
this in error, please contact the sender and delete the material from any 
computer.

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

 Ahhh...imagining that irresistible "new car" smell?
Check out new cars at Yahoo! Autos. 


--------------------------------
The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or
privileged material. Any review, retransmission, dissemination or
other use of, or taking of any action in reliance upon, this
information by persons or entities other than the intended recipient
is prohibited. If you received this in error, please contact the
sender and delete the material from any computer.
 

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users