Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Converting Hexadecimal to Decimal

$
0
0

Good Day Fellow SQL Pro's,

I have a task on my hands that has left me stumped. I need to convert data that I receive hourly which is in a hexadecimal format, from which I need to convert it into a decimal value.

Basically what this is, is data from a soil probe that records Moisture and Temperature Levels. Each hour I get the latest readings sent to my FTP Server. I need to interpret the data so that I can import it into SQL in order for me to design SSRS Graph reports.

I have the basic details down, but it's the long values that I'm struggling with.

Below is an exact example of what I receive:

@LOAD,11606,1405151230,777B78130000000000000000,7D7900000000,010800003324#
@LOAD,11606,1405151300,776D780B0000000000000000,7F7B00000000,011000000024#
@LOAD,11606,1405151330,776D780B0000000000000000,827E00000000,011700000024#

@LOAD,11606,1405151400,7774780B0000000000000000,837F00000000,011D00000024#

As you can tell, this is a CSV file and the most important information for me at the moment is within columns 4, 5 and 6.

Column 1 can be ignored (@LOAD)

Column 2 is the devices ID (11606)

Column 3 is the Date Time Stamp (1405151230, 1405151300 etc.)

Column 4 needs to be converted (777B78130000000000000000, 776D780B0000000000000000 etc.)

Column 5 needs to be converted (7D7900000000, 7F7B00000000 etc.)

Column 6 needs to be converted (010800003324#, 011000000024# etc.)

If anyone has ever worked with type of data then please can you guide me on how to convert this information into something that is relevant! This conversion will result in me creating some great graphs.

Í am beyond confusion because I cannot find anything that can help me.

Any advice would be FANTASTIC



Viewing all articles
Browse latest Browse all 23857

Trending Articles



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