Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
I have two date columns in a table and our want QlikView to compare the two dates for each row but it is not doing correctly. my guess is that the two sets of dates are in a different format,so I tried converting both to a number using Num or converting both to Date but still having issues. Any ideas?
 
					
				
		
I tried this but still did not work. Could it be anything else?
 
					
				
		
My version of QlikView did not understand the cast command
 
					
				
		
 vishsaggi
		
			vishsaggi
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		May be try this? Extending Sunnys expression.
LOAD *
Where LEADCREATEDATEdup > STAGEMODIFYDATE;
Load *,
     Date#(LEADCREATEDATE, 'DD-MMM-YYYY') as LEADCREATEDATEdup,
     Date#(STAGEMODIFYDATE, 'DD-MMM-YYYY') as STAGEMODIFYDATEdup
Resident onlymodifydateforopps ;
Drop Table onlymodifydateforopps;
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		What format is STAGEMODIFYDATE and LEADCREATEDATE are in?
 
					
				
		
MM/DD/YYYY which is what I used instead of the one you gave me
 
					
				
		
To be precise, the original format looks something like this:
12/21/2015 5:04:57 PM
To me the time of day piece is not important really.
 
					
				
		
This is the format for both of them
 
					
				
		
Did you mean the top portion to say
LOAD *
Where LEADCREATEDATEdup > STAGEMODIFYDATEdup;
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Then try this:
dateforoppsbeforelead:
Load *,
     LEADCREATEDATE as LEADCREATEDATEdup
Resident onlymodifydateforopps
Where Date#(LEADCREATEDATE, 'MM/DD/YYYY h:mm:ss TT') >Date#(STAGEMODIFYDATE, 'MM/DD/YYYY h:mm:ss TT') ;
Drop Table onlymodifydateforopps;
 
					
				
		
should I try timestamp instead or it does not matter?
