Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
I have a column in my database (Post_Date) and I need all the Monday dates in that column to point to the previous Friday date. In other words if the Post_Date day is a Monday, it should show the Post_Date to be that of the Friday before.
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		May be like this:
Date(If(WeekDay(Post_Date) = 'Mon', Post_Date - 3, Post_Date)) as Post_Date
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		May be like this:
Date(If(WeekDay(Post_Date) = 'Mon', Post_Date - 3, Post_Date)) as Post_Date
 
					
				
		
It works, thanks a lot!
 
					
				
		
It works only if the column name is changed:
Date(If(WeekDay(Post_Date) = 'Mon', Post_Date - 3, Post_Date)) as Rev_Post_Date
But when I try to use the revised column name for another IF condition in the script, it does not recognize it.
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		That is strange, can you share the complete script and where the issue is?
