Page 1 of 1
		
			
				Date Function
				
Posted: 
Fri Oct 14, 2011 7:34 pm 
				by WStansbury
				I have a table with a STATUS field and a STATUS_DATE field.  In my Conditions, I want to select all records where STATUS = APPFILED and STATUS_DATE is > 90 days old.
I think I should use the @now() function but I do not know the correct syntax for using it.
Can you help?
			 
			
		
			
				Re: Date Function
				
Posted: 
Fri Oct 14, 2011 9:27 pm 
				by admin
				If you just want a "permanent" condition, use the conditions tab:

-here you can enter the >now()-90 as a condition on a date field
Best regards
Bo
 
			 
			
		
			
				Re: Date Function
				
Posted: 
Mon Oct 17, 2011 3:05 am 
				by WStansbury
				I tried your equation and got the following error screen
>now()-90
Dynamic AI can't open the list APPFILED Cases > 90 days:
   
While connecting to the SQL Server database (CLAIMS), a problem arose. 
The issue reported from the database is:
now is not a recognized built-in function name
			 
			
		
			
				Re: Date Function
				
Posted: 
Mon Oct 17, 2011 7:45 am 
				by admin
				For sql server you can use getdate()
Best regards
Bo
			 
			
		
			
				Re: Date Function
				
Posted: 
Mon Oct 17, 2011 7:48 pm 
				by WStansbury
				While we are on the subject of dates ---
I want to get the elapsed time from the STATUS_DATE to today's date
I think I would need to create another column called TODAYDATE, @date(), and then create a formula of something like ddiff(d,TODAYDATE - STATUS_DATE)
Tried in a couple of areas and kept on getting SQL errors
			 
			
		
			
				Re: Date Function
				
Posted: 
Mon Oct 17, 2011 8:20 pm 
				by admin
				You can do something like
cast(getdate()-status_date as integer) 
- this will return a whole number of days between the two dates. 
Best regards
Bo
			 
			
		
			
				Re: Date Function
				
Posted: 
Mon Oct 17, 2011 11:03 pm 
				by WStansbury
				Thank You Mr. Andersen for your accurate and quick responses!!