Syntax question?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using a DLookup expression and am checking two date controls on my
report what is the syntax for dtae fields eg here is an example
DLookup("[field1]","table1","[Date1]=[Date2]")
I recall the these last two date fileds should be surrounded by & and " but
can't work out how?
Thanks
Tony
 
DLookup("[field1]","table1","[Date1] = #" & [Date2] & "#")

HTH,
Debbie


|I am using a DLookup expression and am checking two date controls on my
| report what is the syntax for dtae fields eg here is an example
| DLookup("[field1]","table1","[Date1]=[Date2]")
| I recall the these last two date fileds should be surrounded by & and "
but
| can't work out how?
| Thanks
| Tony
 
Thanks Debbie but didn't work. here is my DLookup
=DLookUp("[Sum Of txtDomfactotqtr]","qrytest2","[txtMonthlabel]= #" &
[txtprevqtr] & "#")
This is a control on a report called test2 which is based on a query
qrytest2
Am I doing anything wrong here?
Thanks
Tony
 
When you say "didn't work" what does that mean? Are you getting an error?

Is the DLookup the control source of the control called test2?
If not, what is the name of the control?


| Thanks Debbie but didn't work. here is my DLookup
| =DLookUp("[Sum Of txtDomfactotqtr]","qrytest2","[txtMonthlabel]= #" &
| [txtprevqtr] & "#")
| This is a control on a report called test2 which is based on a query
| qrytest2
| Am I doing anything wrong here?
| Thanks
| Tony
|
| | > DLookup("[field1]","table1","[Date1] = #" & [Date2] & "#")
| >
| > HTH,
| > Debbie
| >
| >
message
| > | > |I am using a DLookup expression and am checking two date controls on my
| > | report what is the syntax for dtae fields eg here is an example
| > | DLookup("[field1]","table1","[Date1]=[Date2]")
| > | I recall the these last two date fileds should be surrounded by & and
"
| > but
| > | can't work out how?
| > | Thanks
| > | Tony
| >
|
|
 
Tony,
Is the field txtMonthLabel a date/time data type? Is txtPrevQtr a date/time
field or expression?
 
I tried my DLookup with actual dates rather than field names and in typical
British imperialistic mode assumed the UK format would work. It didn't so I
tried American format and it did. Now where in the Help screens does it say
that! Ah well we learn as we tread the long weary road to success! Thanks to
you both for your help.
Tony
Duane Hookom said:
Tony,
Is the field txtMonthLabel a date/time data type? Is txtPrevQtr a date/time
field or expression?

--
Duane Hookom
MS Access MVP


DebbieG said:
When you say "didn't work" what does that mean? Are you getting an error?

Is the DLookup the control source of the control called test2?
If not, what is the name of the control?


| Thanks Debbie but didn't work. here is my DLookup
| =DLookUp("[Sum Of txtDomfactotqtr]","qrytest2","[txtMonthlabel]= #" &
| [txtprevqtr] & "#")
| This is a control on a report called test2 which is based on a query
| qrytest2
| Am I doing anything wrong here?
| Thanks
| Tony
|
| | > DLookup("[field1]","table1","[Date1] = #" & [Date2] & "#")
| >
| > HTH,
| > Debbie
| >
| >
message
| > | > |I am using a DLookup expression and am checking two date controls on
my
| > | report what is the syntax for dtae fields eg here is an example
| > | DLookup("[field1]","table1","[Date1]=[Date2]")
| > | I recall the these last two date fileds should be surrounded by &
and
"
| > but
| > | can't work out how?
| > | Thanks
| > | Tony
| >
|
|
 
Back
Top