Skip to main content
Answer

How to get the day name from a Date?

  • February 23, 2023
  • 2 replies
  • 238 views

Allshashw
Freshman I

Does anyone know how to get the day name (‘Monday’, Tuesday’) from a date?  Building a report for employee timecard tacking, but the records only have the date. Based on the given date we need to get the day. For ex: 20/02/2023 ‘Monday’   8:00h

 

Best answer by hkabiri

@Allshashw  You can use =DayOfWeek(YourDate ) and switch case to display the day as result of this function is 0-6

 

Something like this

=Switch(  DayOfWeek( YourDate )= 0, 'Sat',
 DayOfWeek( [CATran.TranDate] )= 1,'Mon',
DayOfWeek( [CATran.TranDate] )= 2,'Tue',
DayOfWeek( [CATran.TranDate] )= 3,'Wed',
DayOfWeek( [CATran.TranDate] )= 4,'Thu',
DayOfWeek( [CATran.TranDate] )= 5,'Fri',
DayOfWeek( [CATran.TranDate] )= 6,'Sat')

2 replies

hkabiri
Acumatica Moderator
Forum|alt.badge.img+8
  • Acumatica Support Team
  • Answer
  • February 23, 2023

@Allshashw  You can use =DayOfWeek(YourDate ) and switch case to display the day as result of this function is 0-6

 

Something like this

=Switch(  DayOfWeek( YourDate )= 0, 'Sat',
 DayOfWeek( [CATran.TranDate] )= 1,'Mon',
DayOfWeek( [CATran.TranDate] )= 2,'Tue',
DayOfWeek( [CATran.TranDate] )= 3,'Wed',
DayOfWeek( [CATran.TranDate] )= 4,'Thu',
DayOfWeek( [CATran.TranDate] )= 5,'Fri',
DayOfWeek( [CATran.TranDate] )= 6,'Sat')


Allshashw
Freshman I
  • Author
  • Freshman I
  • February 23, 2023

@Allshashw  You can use =DayOfWeek(YourDate ) and switch case to display the day as result of this function is 0-6

 

Something like this

 

=Switch(  DayOfWeek( YourDate )= 0, 'Sat',
 DayOfWeek( [CATran.TranDate] )= 1,'Mon',
DayOfWeek( [CATran.TranDate] )= 2,'Tue',
DayOfWeek( [CATran.TranDate] )= 3,'Wed',
DayOfWeek( [CATran.TranDate] )= 4,'Thu',
DayOfWeek( [CATran.TranDate] )= 5,'Fri',
DayOfWeek( [CATran.TranDate] )= 6,'Sat')

 

Thanks a lot! this is working.