Show Data for this week only (1 Viewer)

Jaydub1991

New member
Local time
Today, 18:43
Joined
Sep 21, 2021
Messages
10
Afternoon!

I have quite an extensive database which has many different types of data, I am looking to show on the front page only specific jobs which have a completion date in the current calendar week and older.
Currently it shows jobs completing in the month but I cannot seem to figure out how to do the week.

In the Query it looks like this

1712588661548.png


any help would be greatly appreciated, and if anyone fancies a future project I am looking for some help with the database moving forward, I have quite limited time and the database is ever changing!
 

Gasman

Enthusiastic Amateur
Local time
Today, 18:43
Joined
Sep 21, 2011
Messages
14,326
Look at the DatePart() function.

TempVars("WeekNum").Value = DatePart("ww", Me.cboDates.Column(1))

.
 

Jaydub1991

New member
Local time
Today, 18:43
Joined
Sep 21, 2021
Messages
10
Look at the DatePart() function.

TempVars("WeekNum").Value = DatePart("ww", Me.cboDates.Column(1))

.

It would need to show the current week and update automatically if possible.

(to be honest I am a total novice so this went over my head)
 

plog

Banishment Pending
Local time
Today, 12:43
Joined
May 11, 2011
Messages
11,648
Does that field you showed us produce the correct week for each record?

If so, in the criteria area under it, copy the function you have and replace [AnticipatedFinishDate] with Date()
 

cheekybuddha

AWF VIP
Local time
Today, 18:43
Joined
Jul 21, 2014
Messages
2,281
If you change to SQL view you can make the WHERE clause look like:
SQL:
...
WHERE AnticipatedCompletionDate >= DateSerial(Year(Date()), Month(Date()), Day(Date()) - (WeekDay(Date(), 2) - 1))
  AND AnticipatedCompletionDate < DateAdd("d", 5, DateSerial(Year(Date()), Month(Date()), Day(Date()) - (WeekDay(Date(), 2) - 1)))
...
(untested!)
 

Users who are viewing this thread

Top Bottom