([Totalt]) = Date()

  • Thread starter bg-consult as, Leif Hauge
  • Start date
B

bg-consult as, Leif Hauge

Heisan !

Jeg har en database som logger telefonsamtaler, og skal oppdatere
logg-skjemaet mitt så jeg ser dagens samtaler listet opp. Her dukker det opp
et banalt (?)problem som jeg gjerne skulle hatt litt hjelp til :

- En spørring henter ut data fra loggen, der et felt i tabellen som
spørringen henter data fra heter "Opprettet".
- Skjemaet teller totalt antall logger fra spørringen og viser det i en
tekstboks (dette fungerer fint ).

Jeg ønsker at en tekstboks viser totalt antall logger _kun fra i dag_, jeg
har en filterregel <!-- ([Opprettet]) = Date() --> som vil fungere men har
problemer med hvordan denne skal legges inn for tekst-boksen, da det ikke er
et eget sted for filter-regler på en tekst-boks. Må jeg bruke en macro for å
få filtrert dette eller kan jeg skrive noe direkte i tekstboksen som
filtrerer ut dagens logger ?

Tips mottas med takk.

Vennlig hilsen
Leif Hauge
 
R

RoyVidar

bg-consult as said:
Heisan !

Jeg har en database som logger telefonsamtaler, og skal oppdatere
logg-skjemaet mitt så jeg ser dagens samtaler listet opp. Her dukker
det opp et banalt (?)problem som jeg gjerne skulle hatt litt hjelp
til :

- En spørring henter ut data fra loggen, der et felt i tabellen som
spørringen henter data fra heter "Opprettet".
- Skjemaet teller totalt antall logger fra spørringen og viser det i
en tekstboks (dette fungerer fint ).

Jeg ønsker at en tekstboks viser totalt antall logger _kun fra i
dag_, jeg har en filterregel <!-- ([Opprettet]) = Date() --> som vil
fungere men har problemer med hvordan denne skal legges inn for
tekst-boksen, da det ikke er et eget sted for filter-regler på en
tekst-boks. Må jeg bruke en macro for å få filtrert dette eller kan
jeg skrive noe direkte i tekstboksen som filtrerer ut dagens logger ?

Tips mottas med takk.

Vennlig hilsen
Leif Hauge

Hei Helge!

Dette er en engelskspråklig NG ...

Du skal kunn bruke funksjonen DCount for dette i kontrollkilden til
tekstboksen din.

=DCount("*","tblDinTabell","[Opprettet] = Date()")

Dersom feltet finnes i postkilden til skjemaet, ville du også kunne
bruke noe slikt

=Sum(Abs([Opprettet] = Date()))

som kontrollkilde

This is an English NG ...

You should be able to get this count through usage of the DCount
function in the controlsource of your text control.

=DCount("*","tblDinTabell","[Opprettet] = Date()")

If the field is in the recordsource of the form, you should also be
able
to use something like this

=Sum(Abs([Opprettet] = Date()))

as controlsource of a text control.
 
B

bg-consult as, Leif Hauge

RoyVidar said:
Should have been, Hei Leif! <blush>

Thanks alot for your reply, I just saw "news.microsoft.no" and thought it
was norwegian, silly me.

Regards
Leif
 
B

bg-consult as, Leif Hauge

RoyVidar said:
<[email protected]>:
Hei Leif!

You should be able to get this count through usage of the DCount
function in the controlsource of your text control.

=DCount("*","tblDinTabell","[Opprettet] = Date()")

If the field is in the recordsource of the form, you should also be able to use something like this :
=Sum(Abs([Opprettet] = Date()))

as controlsource of a text control.

After testing this, the "=Sum" was the answer to my question. Thanks again
for that. A follow-up question arrives because the DCount will not work for
me.

The table is called "Teller", one field name is "Varighet" where I store the
call durations. To be able to calculate the total call duration for today, I
guess I would have to use DCount, but since I cannot make it work I need
more help =)

What I have tried is this :
DCount("*","Teller","[Opprettet]=Date()")
DCount("Varighet","Teller","[Opprettet]=Date()")
DCount("Varighet","
.[Teller]","[Opprettet]=Date()")

When I add "=" in front of DCount I only get an error message saying I have
inserted an invalid syntax. Ideas ?

Regards
Leif Hauge
 
R

RoyVidar

bg-consult as said:
After testing this, the "=Sum" was the answer to my question. Thanks
again for that. A follow-up question arrives because the DCount will
not work for me.

The table is called "Teller", one field name is "Varighet" where I
store the call durations. To be able to calculate the total call
duration for today, I guess I would have to use DCount, but since I
cannot make it work I need more help =)

What I have tried is this :
DCount("*","Teller","[Opprettet]=Date()")
DCount("Varighet","Teller","[Opprettet]=Date()")
DCount("Varighet","
.[Teller]","[Opprettet]=Date()")

When I add "=" in front of DCount I only get an error message saying
I have inserted an invalid syntax. Ideas ?

Regards
Leif Hauge


Ah, sorry, those of us using comma as decimalseparator, have a bit more
fun in the GUI, we have to use semicolon

=DCount("Varighet";"Teller";"[Opprettet]=Date()")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top