Find Jobs
Hire Freelancers

Rewrite SQL Query 2012 - 2008

$30-250 USD

Completed
Posted over 7 years ago

$30-250 USD

Paid on delivery
I would like a script that replaces the following query that only runs in SQL2012 but need this to run in SQL Server 2008R2. Data that comes from the EVENT_TIMESTAMP column varchar(100) is in the following format '2016-12-12 14:25:36.789Z' SQL Server 2012 Query: SELECT DATEADD(HH, 10, IIF(CHARINDEX('Z', e.[EVENT_TIMESTAMP]) > 0, SUBSTRING(CAST(e.[EVENT_TIMESTAMP] AS CHAR), 1,19), SUBSTRING(CAST(e.[EVENT_TIMESTAMP] AS CHAR), 1,24))) AS DateTime, e.EVENT_TIMESTAMP FROM dbo.WMB_MSGS AS e Note: Not all entries in EVENT_TIMESTAMP column have the 'z' eg. 2016-10-12 14:75:36.819 at the end hence the need to filter. ************* Below is what I have so far you choose to use this or not but note the query. declare @event table (ID varchar(max)) insert into @event SELECT event_timestamp FROM dbo.WMB_MSGS WITH (nolock) Where EVENT_TIMESTAMP > '20170101' select ID, replace(ID,'Z',''), --Ignore entries that don't have a 'z' in them. cast( replace(id,'Z','') as datetime), dateadd(hour,10, replace(id,'Z','') ) From @event -------------------------------- Maximum I am offering for this query is $70
Project ID: 12742455

About the project

9 proposals
Remote project
Active 7 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hello, I have looked into query and I have already make it working in my local system. I can do quickly for you and deliver it right away. I have 6.5+ years of experience and have very good hand on SQL. Once you will work with me, you will hire me for your future project because of my quality work and helping nature. Thanks
$30 USD in 0 day
5.0 (92 reviews)
7.8
7.8
9 freelancers are bidding on average $83 USD for this job
User Avatar
I am 9+ Years of Experienced Software Developer. ASP .Net , C# , VB .Net , Visual Basic, Excel VBA , MS SQL Server , MYSQL , Oracle , MS Access, Crystal Report, Telerik , Bootstrap , HTML 5 , CSS , Java Script are my working domain. I am confident to complete the project.
$70 USD in 1 day
4.9 (34 reviews)
5.1
5.1
User Avatar
You are trying to cast the varchar column into a datetime based on the format it has and then add 10 hourse to the date. Are you sure you don't want to do that based on the timezone? Anyway, this will be no problem either way - I can solve your problem. What's the exact error you're getting with the 2012-version? Can I get access to the server, I don't want to install an old sql server somewhere for such a small project if I can avoid it. I would also suggest to add a computed column to the table once we know how to parse the date, so you can directly select from the table without having to remember how to cast every time.
$70 USD in 1 day
5.0 (10 reviews)
5.0
5.0
User Avatar
Please review my profile. I have 7.1 years experience in SQL. Please let me know more details and when we will start. Sky pe: jikenjd
$30 USD in 0 day
5.0 (24 reviews)
4.2
4.2
User Avatar
Dear Sir, Wishing you a Happy new year I am a committed web and window developer and I have 5 years of both freelance and agency experience that will ensure I meet your brief with a professional and cost-effective solution. I have worked on SQL Server 2008 R2 to 2012. I can easily solve this query. Kind Regards Abhishek
$70 USD in 3 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of AUSTRALIA
Melbourne, Australia
5.0
83
Payment method verified
Member since May 25, 2009

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.