A
Aivars
Hello,
I am getting #Error in VAL field when I do very simple query based on
qryKS3 query:
SELECT *
FROM qryKS3
WHERE round([SUMMA],2)>=0.01
here is qryKS3:
PARAMETERS [DATUMSLIDZ] DateTime;
select
"doc_parc" as DOC,
[DATUMSLIDZ] as DATUMS,
"mana_parc" as [TEXT],
IIF(Q2.EXCHDIF>=0,"82500",Q2.KONTS) as DEB,
IIF(DEB=Q2.KONTS,"81500",Q2.KONTS) as KRED,
0 as VSUM,
Q2.CURR1 as [VAL],
abs(Q2.EXCHDIF) as SUMMA,
Q2.RATE as KURS,
iif(DEB=Q2.KONTS,Q2.PKONTS,"") as PACCD,
IIF(KRED=Q2.KONTS,Q2.PKONTS,"") as PACCC
from qryKS2 as Q2
qryKS3 is based on qryKS2
and qryKS3 itself works as expected.
qryKS2 goes like this:
PARAMETERS [DATUMSLIDZ] DateTime;
SELECT
Q1.KONTS,
Q1.CURR1,
Q1.PKONTS,
sum(
Q1.VATL
) AS VSAL,
sum(
Q1.LATL
) AS LSAL,
(SELECT
Kurss
FROM
tblKURSI
WHERE
tblKURSI.Datums=[DATUMSLIDZ]
AND
tblKURSI.ValutasKods=CURR1) as RATE,
Nz(RATE,1) * VSAL AS PERSALATL, LSAL-PERSALATL as EXCHDIF
FROM qryKS1 as Q1 group by Q1.KONTS,Q1.CURR1,Q1.PKONTS
I am using Access 2003 and can be considered as newbee.
Thank you all very much
Aivars
I am getting #Error in VAL field when I do very simple query based on
qryKS3 query:
SELECT *
FROM qryKS3
WHERE round([SUMMA],2)>=0.01
here is qryKS3:
PARAMETERS [DATUMSLIDZ] DateTime;
select
"doc_parc" as DOC,
[DATUMSLIDZ] as DATUMS,
"mana_parc" as [TEXT],
IIF(Q2.EXCHDIF>=0,"82500",Q2.KONTS) as DEB,
IIF(DEB=Q2.KONTS,"81500",Q2.KONTS) as KRED,
0 as VSUM,
Q2.CURR1 as [VAL],
abs(Q2.EXCHDIF) as SUMMA,
Q2.RATE as KURS,
iif(DEB=Q2.KONTS,Q2.PKONTS,"") as PACCD,
IIF(KRED=Q2.KONTS,Q2.PKONTS,"") as PACCC
from qryKS2 as Q2
qryKS3 is based on qryKS2
and qryKS3 itself works as expected.
qryKS2 goes like this:
PARAMETERS [DATUMSLIDZ] DateTime;
SELECT
Q1.KONTS,
Q1.CURR1,
Q1.PKONTS,
sum(
Q1.VATL
) AS VSAL,
sum(
Q1.LATL
) AS LSAL,
(SELECT
Kurss
FROM
tblKURSI
WHERE
tblKURSI.Datums=[DATUMSLIDZ]
AND
tblKURSI.ValutasKods=CURR1) as RATE,
Nz(RATE,1) * VSAL AS PERSALATL, LSAL-PERSALATL as EXCHDIF
FROM qryKS1 as Q1 group by Q1.KONTS,Q1.CURR1,Q1.PKONTS
I am using Access 2003 and can be considered as newbee.
Thank you all very much
Aivars