Hello,
I can't find the relation between those 2 columns, can you guys help me?

Hello,
I can't find the relation between those 2 columns, can you guys help me?

so, the secondValueA changes everytime the time changes.. here i'm collecting data every 30 secs
thank you
i tried this (SELECT DATEDIFF(ms, (select sqlserver_start_time from
sys.dm_os_sys_info), '2021-03-29 14:10:07.159')) but ...
It seems possible to identify an approximate relation between date and SecondValueA. Check an example:
declare @date as datetime2 = cast('2021-03-29 14:12:37.163' as datetime2)
declare @secondValueA bigint
declare @x1 datetime2 = cast('2021-03-29 14:10:07.159' as datetime2)
declare @x2 datetime2 = cast('2021-03-29 14:15:37.162' as datetime2)
declare @y1 bigint = cast(-232845330 as bigint)
declare @y2 bigint = cast(-1227785454 as bigint) + cast(0x100000000 as bigint)
set @secondValueA = @y1 + (@y2 - @y1) * datediff_big(mcs, @x1, @date) / datediff_big(mcs, @x1, @x2)
if @secondValueA > 0x7FFFFFFF set @secondValueA -= cast(0x100000000 as bigint)
select @date as [date], @secondValueA as SecondValueA
hello!
thank you but is there a way to find 'SecondValueA' with 'date'?
The thing is i collect data every 30 sec, and what i'm searching for is one function f(date) = SecondValueA.
The first line is a sample input date. Then the code evaluates the value of SecondValueA for this date. Do you need the inverse calculation (getting date from given SecondValueA)?
yes but you're also using x1,x2,y1,y2. It seems like you needed these values to obtain SecondValueA for the given date. I don't understand but thank you though
Hi @Miiimy7-1570,
Every 30 seconds SecondvalueA increases by about 299930364:
select 67219244-(-2328453330)
select 367172064-67219244
select 667144628-367172064
select 967261916-667144628
select 1267192280-967261916

I'm not sure if the relationship between the two columns you are looking for is a direct link between the data between the two columns.
Regards
Echo
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
hello!
thank you but what about negative values? i'm looking for a function f(date) = secondValueA
9 people are following this question.