R
Richard
Dear all,
I have one table TblCW with as below:
[Date] as date/time record type
[TimeStamp] as date/time ...
+ other data fields
Then I have a query QryCPK which takes both [Date] and [TimeStamp] like:
CDate([Date]) AS Datum
TimeValue([TimeStamp]) AS [Time].
Then I have another query "QryTotErrs" for further calculations and TOTALs
which links both TblCW and QryCPK and joins are like:
[TimeStamp].TblCW 1---1 [Time].QryCPK,
[Date].TblCW 1---1 [Datum].QryCPK
By which I of course need all the data which are equal. What happens is:
- Some data are missing! (I should have obtained 231 records, but obrained
only 66!!!)
- If I used 1 ----> "many" join property TblCW ----> QryCPK, I obtained all
necessary records from TblCW but some some fields, like where "iif" function
used in Qry.CPK showed "#Error" and other were blank (null).
I check those joined fields from those records which were missing from both
TblCW and QryCPK even in Excel, and matched absolutely!
Could anybody help?
THANKS
Complete SQL statement for the "wrong working QRY":
SELECT QryCPK.CW, tbl_CW.MachineNumber,
Format([Date],"ww")-1 AS Week,
tbl_CW.Date,
tbl_CW.TimeStamp,
QryCPK.Shift FROM tbl_CW LEFT JOIN QryCPK ON
(tbl_CW.MachineNumber = QryCPK.MachineNumber) AND (tbl_CW.Date =
QryCPK.Datum) AND (tbl_CW.TimeStamp = QryCPK.Time)
ORDER BY tbl_CW.MachineNumber, Format([Date],"ww")-1, tbl_CW.Date,
tbl_CW.TimeStamp;
I have one table TblCW with as below:
[Date] as date/time record type
[TimeStamp] as date/time ...
+ other data fields
Then I have a query QryCPK which takes both [Date] and [TimeStamp] like:
CDate([Date]) AS Datum
TimeValue([TimeStamp]) AS [Time].
Then I have another query "QryTotErrs" for further calculations and TOTALs
which links both TblCW and QryCPK and joins are like:
[TimeStamp].TblCW 1---1 [Time].QryCPK,
[Date].TblCW 1---1 [Datum].QryCPK
By which I of course need all the data which are equal. What happens is:
- Some data are missing! (I should have obtained 231 records, but obrained
only 66!!!)
- If I used 1 ----> "many" join property TblCW ----> QryCPK, I obtained all
necessary records from TblCW but some some fields, like where "iif" function
used in Qry.CPK showed "#Error" and other were blank (null).
I check those joined fields from those records which were missing from both
TblCW and QryCPK even in Excel, and matched absolutely!
Could anybody help?
THANKS
Complete SQL statement for the "wrong working QRY":
SELECT QryCPK.CW, tbl_CW.MachineNumber,
Format([Date],"ww")-1 AS Week,
tbl_CW.Date,
tbl_CW.TimeStamp,
QryCPK.Shift FROM tbl_CW LEFT JOIN QryCPK ON
(tbl_CW.MachineNumber = QryCPK.MachineNumber) AND (tbl_CW.Date =
QryCPK.Datum) AND (tbl_CW.TimeStamp = QryCPK.Time)
ORDER BY tbl_CW.MachineNumber, Format([Date],"ww")-1, tbl_CW.Date,
tbl_CW.TimeStamp;