|
|
=DSum("[Amount]","Deposits","[DateDep] =#" & [Text21] & "#")
why am I getting "syntax error in date in query expression"?
thanks
|
|
Try:
with the assumption that [Text21] is the name of a control, not a field, I would try:
=DSUM("Amount", "Deposits", "[DateDep] = #" & me.text21 & "#")
-- HTH Dale
email address is invalid Please reply to newsgroup only.
"Gator" wrote:
[Quoted Text] > =DSum("[Amount]","Deposits","[DateDep] =#" & [Text21] & "#") > > why am I getting "syntax error in date in query expression"? > > thanks
|
|
I get the error... the object doesn't contain the automation object 'me'
"Dale Fye" wrote:
[Quoted Text] > Try: > > with the assumption that [Text21] is the name of a control, not a field, I > would try: > > =DSUM("Amount", "Deposits", "[DateDep] = #" & me.text21 & "#") > > -- > HTH > Dale > > email address is invalid > Please reply to newsgroup only. > > > > "Gator" wrote: > > > =DSum("[Amount]","Deposits","[DateDep] =#" & [Text21] & "#") > > > > why am I getting "syntax error in date in query expression"? > > > > thanks
|
|
I got it.... =DSum("Amount","Deposits","[DateDep] = #" & [text21] & "#")
thanks
"Gator" wrote:
[Quoted Text] > I get the error... > the object doesn't contain the automation object 'me' > > "Dale Fye" wrote: > > > Try: > > > > with the assumption that [Text21] is the name of a control, not a field, I > > would try: > > > > =DSUM("Amount", "Deposits", "[DateDep] = #" & me.text21 & "#") > > > > -- > > HTH > > Dale > > > > email address is invalid > > Please reply to newsgroup only. > > > > > > > > "Gator" wrote: > > > > > =DSum("[Amount]","Deposits","[DateDep] =#" & [Text21] & "#") > > > > > > why am I getting "syntax error in date in query expression"? > > > > > > thanks
|
|
so, is "text21" actually a field name?
-- HTH Dale
email address is invalid Please reply to newsgroup only.
"Gator" wrote:
[Quoted Text] > I got it.... > =DSum("Amount","Deposits","[DateDep] = #" & [text21] & "#") > > thanks > > "Gator" wrote: > > > I get the error... > > the object doesn't contain the automation object 'me' > > > > "Dale Fye" wrote: > > > > > Try: > > > > > > with the assumption that [Text21] is the name of a control, not a field, I > > > would try: > > > > > > =DSUM("Amount", "Deposits", "[DateDep] = #" & me.text21 & "#") > > > > > > -- > > > HTH > > > Dale > > > > > > email address is invalid > > > Please reply to newsgroup only. > > > > > > > > > > > > "Gator" wrote: > > > > > > > =DSum("[Amount]","Deposits","[DateDep] =#" & [Text21] & "#") > > > > > > > > why am I getting "syntax error in date in query expression"? > > > > > > > > thanks
|
|
at this point...it is....
"Dale Fye" wrote:
[Quoted Text] > so, is "text21" actually a field name? > > -- > HTH > Dale > > email address is invalid > Please reply to newsgroup only. > > > > "Gator" wrote: > > > I got it.... > > =DSum("Amount","Deposits","[DateDep] = #" & [text21] & "#") > > > > thanks > > > > "Gator" wrote: > > > > > I get the error... > > > the object doesn't contain the automation object 'me' > > > > > > "Dale Fye" wrote: > > > > > > > Try: > > > > > > > > with the assumption that [Text21] is the name of a control, not a field, I > > > > would try: > > > > > > > > =DSUM("Amount", "Deposits", "[DateDep] = #" & me.text21 & "#") > > > > > > > > -- > > > > HTH > > > > Dale > > > > > > > > email address is invalid > > > > Please reply to newsgroup only. > > > > > > > > > > > > > > > > "Gator" wrote: > > > > > > > > > =DSum("[Amount]","Deposits","[DateDep] =#" & [Text21] & "#") > > > > > > > > > > why am I getting "syntax error in date in query expression"? > > > > > > > > > > thanks
|
|
On Mon, 24 Nov 2008 07:43:03 -0800, Gator wrote:
[Quoted Text] > I get the error... > the object doesn't contain the automation object 'me' > > "Dale Fye" wrote: > >> Try: >> >> with the assumption that [Text21] is the name of a control, not a field, I >> would try: >> >> =DSUM("Amount", "Deposits", "[DateDep] = #" & me.text21 & "#") >> >> -- >> HTH >> Dale >> >> email address is invalid >> Please reply to newsgroup only. >> >> "Gator" wrote: >> >>> =DSum("[Amount]","Deposits","[DateDep] =#" & [Text21] & "#") >>> >>> why am I getting "syntax error in date in query expression"? >>> >>> thanks
You cannot use the "Me" keyword within the control source of an Access control or in a query. "Me" can only be used in VBA.
Your original post states that the DSUM was used in a query (not directly as the control source of a control). You do NOT use the = sign in a query expression. ColumnName:DSum(etc....)
Also, you would need to fully qualify the [Text21] control's address.
ColumnName:DSum("[Amount]","Deposits","[DateDep] = #" & forms!FormName![Text21] & "#")
So, assuming [DateDep] is a Date Datatype and [Text21] contains a valid date, the above should work. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail
|
|
Gator wrote:
[Quoted Text] > =DSum("[Amount]","Deposits","[DateDep] =#" & [Text21] & "#") > > why am I getting "syntax error in date in query expression"? > > thanks
If this is in a query leave the equal sign off This will result in exp1:DSum("[Amount]","Deposits","[DateDep] =#" & [Text21] & "#") and you can rename exp1 to something meaningful
|
|
|