Home Forums SQL Server 2005 T-SQL (SS2K5) Need help conveting this from Mysql to SQL server RE: Need help conveting this from Mysql to SQL server

  • Single quotes within single quotes may be causing issues. Try this instead:

    select *

    from openquery([connection], '

    -- Forum Messages by User

    use databasebname;

    select u.name, convert_tz(from_unixtime(m.modificationDate/1000),''+00:00'',''-08:00'') as TimePST, m.subject, m.body, m.messageID, f.forumID, f.name

    from jiveMessage m inner join

    jiveUser u on m.userID = u.userID inner join

    jiveForum f on m.forumID = f.forumID

    where from_unixtime(m.modificationDate/1000) > date_sub(now(), interval 1 week)

    and u.name like ''Luke''

    order by m.modificationDate desc ')

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.