Formula in Access Query to genrate numbers

K

K

I have query with the name "Data" and in this query I have one column
with the name "Dates" and in that column I have dates like see below

Dates………col heading
06/10/2004
06/10/2004
06/10/2004
07/10/2004
07/10/2004
09/10/2004
09/10/2004
09/10/2004
09/10/2004


In query design view I need some kind of formula in next column of
"Dates" column that when I run query then I should get result like
see
below


Dates Num...col heading
06/10/2004 1
06/10/2004 1
06/10/2004 1
07/10/2004 2
07/10/2004 2
09/10/2004 3
09/10/2004 3
09/10/2004 3
09/10/2004 3


Please can any friend can help
 
B

Bob Barrows

K said:
I have query with the name "Data" and in this query I have one column
with the name "Dates" and in that column I have dates like see below

Dates………col heading
06/10/2004
06/10/2004
06/10/2004
07/10/2004
07/10/2004
09/10/2004
09/10/2004
09/10/2004
09/10/2004


In query design view I need some kind of formula in next column of
"Dates" column that when I run query then I should get result like
see
below


Dates Num...col heading
06/10/2004 1
06/10/2004 1
06/10/2004 1
07/10/2004 2
07/10/2004 2
09/10/2004 3
09/10/2004 3
09/10/2004 3
09/10/2004 3


Please can any friend can help

Assuming [Dates] is a Date/Time column, and your requirement is to show
the months numbered 1-12 starting with June, and assuming that January
would be month 8, then this will work:

Num:iif(Month([Dates])>5,Month([Dates]) + 7, Month([Dates])-5)
 

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