Formula in Access Query to genrate numbers

  • Thread starter Thread starter K
  • Start date Start date
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
 
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)
 
Back
Top