473,396 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Dcount and SQL expression

Hello,

I use Access 2000 and i want to use the Dcount function in a form.

I try to build this expression in a texte zone : I tried many ways usuing
and mixing " and/or ' but Access always says "Error" !

=Dcount("*";"Table1";"Isnull([dpt]) and left([Call];1)="F"")

This is to count the number of record(s) where the field [dpt] is empty AND
the field [Call] begins with the F letter.

[dpt] and [Call] are two fields of table1.

Could you help me ?

73 from F6GGR

May 22 '06 #1
9 2626
When embedding quotes, you have to do something "special" so that Access/VBA
know that you intend to embed the quotes and not that the end of the line
comes sooner. As you have it written, Access thinks that the quote between
the = and the F is the end of the line and it doesn't know what to do with
the remainder. To let Access know that you really intended to embed the
quotes, you need to double them.

Try:
=Dcount("*";"Table1";"Isnull([dpt]) and left([Call];1)=""F""")

--
Wayne Morgan
MS Access MVP
"F6GGR" <no****@wanadoo.fr> wrote in message
news:44***********************@news.wanadoo.fr...
Hello,

I use Access 2000 and i want to use the Dcount function in a form.

I try to build this expression in a texte zone : I tried many ways usuing
and mixing " and/or ' but Access always says "Error" !

=Dcount("*";"Table1";"Isnull([dpt]) and left([Call];1)="F"")

This is to count the number of record(s) where the field [dpt] is empty
AND the field [Call] begins with the F letter.

[dpt] and [Call] are two fields of table1.

Could you help me ?

73 from F6GGR

May 22 '06 #2
Thank you for your answer Wayne,

But i am sorry to say it does not works.

Alan;, F6GGR

"Wayne Morgan" <co***************************@hotmail.com> a écrit dans le
message de news: Nx*******************@newssvr27.news.prodigy.net.. .
When embedding quotes, you have to do something "special" so that
Access/VBA know that you intend to embed the quotes and not that the end
of the line comes sooner. As you have it written, Access thinks that the
quote between the = and the F is the end of the line and it doesn't know
what to do with the remainder. To let Access know that you really intended
to embed the quotes, you need to double them.

Try:
=Dcount("*";"Table1";"Isnull([dpt]) and left([Call];1)=""F""")

--
Wayne Morgan
MS Access MVP
"F6GGR" <no****@wanadoo.fr> wrote in message
news:44***********************@news.wanadoo.fr...
Hello,

I use Access 2000 and i want to use the Dcount function in a form.

I try to build this expression in a texte zone : I tried many ways usuing
and mixing " and/or ' but Access always says "Error" !

=Dcount("*";"Table1";"Isnull([dpt]) and left([Call];1)="F"")

This is to count the number of record(s) where the field [dpt] is empty
AND the field [Call] begins with the F letter.

[dpt] and [Call] are two fields of table1.

Could you help me ?

73 from F6GGR


May 22 '06 #3
Then I'll need more information. What about it doesn't work? Do you get an
error message or just not the answers you want? What are you trying to do?

--
Wayne Morgan
MS Access MVP
"F6GGR" <no****@wanadoo.fr> wrote in message
news:44***********************@news.wanadoo.fr...
Thank you for your answer Wayne,

But i am sorry to say it does not works.

May 22 '06 #4
It appears it doesn't like the IsNull() function either. Try this instead:

=Dcount("*";"Table1";"[dpt] Is Null and left([Call];1)=""F""")

--
Wayne Morgan
MS Access MVP
"F6GGR" <no****@wanadoo.fr> wrote in message
news:44***********************@news.wanadoo.fr...
Thank you for your answer Wayne,

But i am sorry to say it does not works.

May 22 '06 #5
Wyane,
Thank you for coming back, I will try to give you the good informations :

The purpose is to to count the number of record(s) where the field [dpt] is
empty AND
the field [Call] begins with the F letter.

I used a textZone in a form and this formula is in SourceControl property.

The formula I tried is exactly : (pasted)

=CpteDom("*";"T_QSO";"Isnull([dpt]) and left([Indicatif];1)=""F""")

where CpteDom is the french translation of Dcount and Indicatif is for call

This still gives me #Erreur ( for "#Error°)

Thank you,

Alan.


May 22 '06 #6
Wayne,

One step more :

=CpteDom("*";"T_QSO";"Isnull([dpt])") Works , but, of course does give the
entire answer.

Still trying....
May 22 '06 #7
Have you tried the [dpt] Is Null option instead? The IsNull() function
returned an error for me when using DCount().

--
Wayne Morgan
MS Access MVP
"F6GGR" <no****@wanadoo.fr> wrote in message
news:44***********************@news.wanadoo.fr...
Wayne,

One step more :

=CpteDom("*";"T_QSO";"Isnull([dpt])") Works , but, of course does give
the entire answer.

Still trying....

May 22 '06 #8
Now it works :

=CpteDom("*";"T_QSO";"[dpt] is null and left([Indicatif],1)=""f""")

note the , instead of ;

I had to use Left instead of the "french" name "gauche"

Bloody Access !

Thank you for all, Wayne

Alan
"Wayne Morgan" <co***************************@hotmail.com> a écrit dans le
message de news: dY******************@newssvr11.news.prodigy.com...
Have you tried the [dpt] Is Null option instead? The IsNull() function
returned an error for me when using DCount().

--
Wayne Morgan
MS Access MVP
"F6GGR" <no****@wanadoo.fr> wrote in message
news:44***********************@news.wanadoo.fr...
Wayne,

One step more :

=CpteDom("*";"T_QSO";"Isnull([dpt])") Works , but, of course does give
the entire answer.

Still trying....


May 22 '06 #9
Your welcome. I'm sorry I didn't realize that Left() didn't translate
properly and that it didn't use your default separator character. That's
nice to know, but my feelings about it match yours.

--
Wayne Morgan
MS Access MVP
"F6GGR" <no****@wanadoo.fr> wrote in message
news:44***********************@news.wanadoo.fr...
Now it works :

=CpteDom("*";"T_QSO";"[dpt] is null and left([Indicatif],1)=""f""")

note the , instead of ;

I had to use Left instead of the "french" name "gauche"

Bloody Access !

May 22 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: jstaggs39 | last post by:
I want to create a Dcount and an If...Then...Else statement to count the number of records in a table based on the date that is entered to run the form. The If....Else statment comes in because if...
7
by: kaosyeti | last post by:
hey.. i have a control in a report that needs to count the records from a table that match the parameters that the user selects when creating the report. the report is created with...
2
by: solar | last post by:
DCount in a query How can i sum up all the fields in the query? My query consists of the table products.The first field is Productid, the second is ProductName. The next fields are the quantities...
1
by: Blue Lagoon Products - Customer Services | last post by:
Hi, Here is my expression =DCount("","tblDownload")>2 I would like to know how many records (including this one?) contain the same 'Buyer ID' as that in txtBuyerID on my report, is this...
7
by: Michael R | last post by:
Good afternoon. I'm stucked in composing the syntax for DCount expression in a select query. The query qryCustomers has CustomerID field, the DCount function uses tblLoans with LoanDate and Id fields...
2
by: MusicMogul | last post by:
Hey Everyone, I'm trying to evaluate the DCOUNT expression. If there were no values found, it gives a "#Error" in my report. That "#Error" message doesn't look good on a report. How can I...
3
by: davidwelli | last post by:
Hello, All help is appreciated, I'm struggling with the following. Using Access 2003 (front end) connecting to Oracle 7 database (back end). I'm trying to create a query in access that will...
8
by: rano575 | last post by:
i am making a database about the survaing instruments in my company and all i want to do i have a query that i collected all the data i want with the design i want and a made group by to the...
4
by: 6afraidbecause789 | last post by:
I was able to glean syntax online for a DCount on a form that counts the number of 'misbehavior' incidents for students for the current day: =DCount("StudentID","Incidents","StudentID=" & Forms!...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.