Formatting Dcount

H

hotplate

On an after update I am using:

[NCMT] = (Format(Date, "ddmmyy") & DCount("*", "[tblNCMT_Log]",
"[NCMT_Date] = #" & Date & "#"))

How do I get format the result so it is "05010901" instead of
"0501091"?

Also, how do I get it to start counting at from 1 not 0 so my first
record for the day wont be "05010900".

Thanks,

Garrett
 
A

Albert D. Kallal

DCount("*", "[tblNCMT_Log]","[NCMT_Date] = #" & Date & "#")


Simply wrap the above in a format command:

format(above,"00")
Also, how do I get it to start counting at from 1 not 0 so my first
record for the day wont be "05010900".

Just add + 1 BEFORE your format:

eg:

format(above + 1,"00")
 

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