Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
sql_server 217
t-sql 211
tsql 116
sqlserver 96
BRH 78
#SQLServer 66
#TSQL 56
SQL Server 34
function 11
SSMS 9

Archive · View All
August 2007 17
August 2010 8
June 2012 7
June 2011 7
November 2007 7
August 2012 6
May 2012 6
November 2011 6
August 2011 6
October 2011 6

Madhivanan's TSQL Blog

SQL Server's equivalent of MS Access functions - Part II

Jan 18 2011 2:45AM by Madhivanan   

In Part I of this series SQL Server's equivalent of MS Access functions, I have posted some direct equivalents. In this post, I post other functions that dont have direct equivalent

Choose : Returns a value from the list based on a given position

declare @list varchar(1000)
declare @select varchar(8000)
declare @t table(list_no int identity(1,1),list varchar(100))
set @select=''
set @list = '"test1","test2","test3","test4"'

set @select= 'select '''+REPLACE(@list,'","','"'' union all select ''"')+''''
insert into @t 
exec(@select)

select list from @t 
where list_no=3

Datevalue : Converts a string to a valid date

select CAST('june30 2010' as datetime)
select CAST('6/30/2010' as datetime)

Timevalue : Converts a string to a Time

select convert(varchar(12),cast('3:12:57 PM' as datetime),108)
select cast(@hour as VARCHAR(2))+':'+RIGHT('0'+cast(@minute as VARCHAR(2)),2)+':'+RIGHT('0'+cast(@second as VARCHAR(2)),2)

Dateserial : Make a valid date based on the year,month and day

declare @year int, @month int, @day int
select @year =2010,@month =6,@day =30
select dateadd(year,@year-1900,dateadd(month,@month-1,dateadd(day,@day ,0)))
select cast(cast(@year  as VARCHAR(4))+RIGHT('0'+cast(@month as VARCHAR(2)),2)+RIGHT('0'+cast(@day as VARCHAR(2)),2) as datetime)

Tags: t-sql, sql_server, sqlserver, tsql, BRH, #TSQL, function, #SQLServer, Access,


Madhivanan
3 · 39% · 12429
2
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

1  Comments  

  • I prefer using SELECT CAST(CAST(@year * 10000 + @month * 100 + @day AS CHAR(8)) AS DATETIME).

    commented on Mar 8 2011 8:55AM
    jathsa
    2893 · 0% · 2

Your Comment


Sign Up or Login to post a comment.

"SQL Server's equivalent of MS Access functions - Part II" rated 5 out of 5 by 2 readers
SQL Server's equivalent of MS Access functions - Part II , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]