mahmed1
Well-known Member
- Joined
- Mar 28, 2009
- Messages
- 2,302
- Office Version
- 365
- 2016
- Platform
- Windows
Hi All
Hope you all are well
I have a column that stores leavingdate but it’s not in a date format
ie 20210115 (15/01/2021) some rows will be blank and others will have leaving dates in there
what I want to do is get a count of how many of the leave dates are future dates (ie > today’s date but I keep getting an error or type error
I also need to take off the hours where the same condition is met...
my attempt
Count Greater than today
Count(DateSerial(Left(tblData.LeavingDate,4),Mid(tblData.LeavingDate,2),Right(tblData.LeavingDate,2))>Date())
Sum Hours Greater than today
Sum(IIf(DateSerial(Left(tblData.LeavingDate,4),Mid(tblData.LeavingDate,5,2),Right(tblData.LeavingDate,2))>Date(), tblData.Hours, 0))
where am I going wrong
Hope you all are well
I have a column that stores leavingdate but it’s not in a date format
ie 20210115 (15/01/2021) some rows will be blank and others will have leaving dates in there
what I want to do is get a count of how many of the leave dates are future dates (ie > today’s date but I keep getting an error or type error
I also need to take off the hours where the same condition is met...
my attempt
Count Greater than today
Count(DateSerial(Left(tblData.LeavingDate,4),Mid(tblData.LeavingDate,2),Right(tblData.LeavingDate,2))>Date())
Sum Hours Greater than today
Sum(IIf(DateSerial(Left(tblData.LeavingDate,4),Mid(tblData.LeavingDate,5,2),Right(tblData.LeavingDate,2))>Date(), tblData.Hours, 0))
where am I going wrong