MS Access Script Conversion to T-Sql script


  • I have a MS Access Script to be converted T-Sql,Can any one help me in this conversion:

    "Equivalent of ms access #1/1/2013# in sql server" 

    I could not find any replcament for MS Access "#" wildcard in sql server 2008

    MS Access: IIf(IsNull([Col1]),([Col2]*[col3]),([col2]*[col3]/[col1])) as Column T-Sql: Case When [Col1] Is Null then ([Col2]*[col3]) else ([col2]*[col3]/[col1]) end AS column Ms Access: IIf(Left([col],1)=3,"Tran",IIf(Left([ss],1)=7,"Con","Sto")) AS [col] T-sql: (Case When (Left([col],1)=3) then 'Tran' else (Case When (Left([col],1)=7) then 'Con' else 'Sto' end )end) AS [col type]


    • Moved by SSISJoostMVP Sunday, October 13, 2013 10:31 AM Not SSIS related
    Saturday, October 12, 2013 7:40 PM


  • # is not a wildcard character in ms access. It simply represents a date constant differentiating from string constants.

    For example,

    SQL Server:     WHERE mydate = '01/01/2013'

    MS Access:       WHERE mydate = #01/01/2013#

    Regards, RSingh

    • Marked as answer by D S S Wednesday, October 16, 2013 1:00 AM
    Sunday, October 13, 2013 1:18 AM

All replies