| 
	
 | 
 Posted by jshunter@waikato.ac.nz on 06/27/07 01:39 
Does anyone know of a built-in function to return the maximum possible 
value of a given datatype? I have to return the biggest value for a 
smalldatetime or datetime in a view if the field is null, but can't 
find such a function. The closest I've come is: 
 
select datalength(cast(getdate() as smalldatetime)) 
 
....but that only return the number of bytes, not the value itself, 
which is '6-6-2079 11:59' 
 
I know I could create my own lookup table and function, but I was 
hoping that Transact-SQL would have a built-in solution 
 
--John Hunter
 
  
Navigation:
[Reply to this message] 
 |