Quantcast
Channel: Questions in topic: "splunk-enterprise"
Viewing all articles
Browse latest Browse all 47296

Splunk DB Connect: How to resolve error "Conversion failed when converting date and/or time from character string" for my SQL query?

$
0
0
Hi guys, Any one has experienced this in ingesting IBM IPS Database? I tried to write a SQL query to return some events from the SensorDataAVP1 table. But the time format is actually a string value like this: `2015-05-09T16:08:47+1200`. I did some Googling, it is ISO8601 format with time zone Z (aka 127). But whatever I try, I always get this error "Conversion failed when converting date and/or time from character string". The original string is in nvarchar format. So I converted it to varchar format first before converting it to datetime. And seems the SQL datetime format doesn't support timezone, so I use datetimeoffset instead. Here is my convert string: convert(datetimeoffset, convert(varchar(40),time),127) AS time Any thoughts? Thanks

Viewing all articles
Browse latest Browse all 47296

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>