|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi
I'm hoping you guys can help me with a problem I've got. I work for a college and have created a db app in Access to track absences. They want to create a query now to find patterns of absences such as someone who has had 3 consecutive mondays off. There are two tables one for student details and one for absences. They are linked on a field called StudID. The absences table contains a field for called [date] and another call [day] (this is calculated from the date automatically in the forms). Is it possible to have an SQL statement that will compare all the dates for a particular student and display those who have 3 dates exactly 7 days apart? |
|
#2
|
||||
|
||||
|
Yes, you'll need to do some research on the DateDiff function to calculate the day/time span.
|
|
#3
|
|||
|
|||
|
Thanks.
I've used Datediff in VB but not in SQL. I've only ever really done basic SQL stuff. Can anybody give advise me on how I would use DateDiff in an SQL query (or point me in the direction of a website)? Thanks |
|
#5
|
|||
|
|||
|
Thanks
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Finding a Pattern |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|