compare datas in a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone help me how to indroduce datas in a form for a period of time and
then
compare them with datas from the same period previous year?
For example

Sum of money from 1/1/5 till 30/4/5
with
Sum of money from 1/1/4 till 30/4/4
 
Can anyone help me how to indroduce datas in a form for a period of time and
then
compare them with datas from the same period previous year?
For example

Sum of money from 1/1/5 till 30/4/5
with
Sum of money from 1/1/4 till 30/4/4

Could you explain how the data is stored in your table, and what you
want to do? I do not understand the question.

You can use a Query with a criterion of
= DateSerial(Year(Date()), 1, 1) AND <= Date()

to get all records between the start of the year and today's date, and
another query with
= DateSerial(Year(Date()) - 1, 1, 1) AND <= DateSerial(Year(Date()) - 1, Month(Date()), Day(Date())

to get the corresponding date range for the previous year. Perhaps you
could use two Subforms or two Subreports to compare the information.

John W. Vinson[MVP]
 
Thank you very very much but perhaps it was my fault
the first day of the year it was in the example i want to calculate any
period i like.
Thank you

Ο χÏήστης "John Vinson" έγγÏαψε:
 
Note that John used

DateSerial(Year(Date()), 1, 1)

to represent the 1st of January for the current year. To get any arbitrary
date, you simply change what values you're passing to the DateSerial
function.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)
 
Thank you very very much but perhaps it was my fault
the first day of the year it was in the example i want to calculate any
period i like.

Then use a criterion of

BETWEEN [Enter start date:] AND [Enter end date:]

You'll be prompted for the dates, and the query will total the values
within that date range.

John W. Vinson[MVP]
 
Back
Top