M
mjhotstone
Hi there,
In Access 2003, I'm having a problem where DLookup is returning a NULL
value instead of the correct value for a field in a query, while an SQL
statement retrieves the correct value. I wrote this quick SQL
statement to demonstrate the problem:
SELECT DateContractAwardDue,
Nz(DLookUp("DateContractAwardDue","qryCSPDetails","TranNumber='065018'"),"null")
AS DL1,
Nz(DLookUp("Created","qryCSPDetails","TranNumber='065018'"),"null") AS
DL2
FROM qryCSPDetails
WHERE qryCSPDetails.TranNumber='065018';
And here's the result (transposed for ease-of-reading):
DateContractAwardDue 12/12/2005
DL1 null
DL2 11/10/2005 10:33:18
As you can see, the SQL SELECT statement correctly returns the date in
the field, while the first DLookup returns null. The second DLookup,
though, correctly returns the date in a different field in the same
query.
Is there a problem with the DLookup function in 2003, or am I missing
something rather obvious?
Thanks!
-matt
In Access 2003, I'm having a problem where DLookup is returning a NULL
value instead of the correct value for a field in a query, while an SQL
statement retrieves the correct value. I wrote this quick SQL
statement to demonstrate the problem:
SELECT DateContractAwardDue,
Nz(DLookUp("DateContractAwardDue","qryCSPDetails","TranNumber='065018'"),"null")
AS DL1,
Nz(DLookUp("Created","qryCSPDetails","TranNumber='065018'"),"null") AS
DL2
FROM qryCSPDetails
WHERE qryCSPDetails.TranNumber='065018';
And here's the result (transposed for ease-of-reading):
DateContractAwardDue 12/12/2005
DL1 null
DL2 11/10/2005 10:33:18
As you can see, the SQL SELECT statement correctly returns the date in
the field, while the first DLookup returns null. The second DLookup,
though, correctly returns the date in a different field in the same
query.
Is there a problem with the DLookup function in 2003, or am I missing
something rather obvious?
Thanks!
-matt