All Questions
11 questions
2
votes
1
answer
51
views
Displaying items between 2 dates
I am creating a commission tracker for a sales team
Commission is payable on a new account on any business brought in for 3 months from the date of the first sale.
The accounts table will have the ...
1
vote
3
answers
226
views
Finding the Second (time) Interval within X of the current time
I have a need to find, for a given current second and upper and lower boundary, find all of the seconds that would fall within that, wrapping at the 59 second mark.
With that word salad out of the way,...
1
vote
0
answers
407
views
Resample time series in SQLite
I have following table:
CREATE TABLE entries (
utc TEXT,
entry INTEGER
);
with following data:
INSERT INTO entries
(utc, entry)
VALUES
('2022-10-01 01:54', 23),
('2022-10-04 02:40', 46),
(...
0
votes
1
answer
151
views
Compare table datetime, SQL & SSIS
I am trying to add a step in my SSIS job where it checks a table (FYI, so this table has only 1column which is a datetime data type that gets updated daily with a datetime from another table) whether ...
0
votes
1
answer
93
views
Select entries with today and tomorrows date
I am using MariaBD and am trying to filter entries with todays date and tomorrows date.
I have managed to filter todays date using
SELECT *,
DateTime AS Time
FROM table
where status = '...
0
votes
1
answer
495
views
select time intervals from a nested query
I have a table which has the following columns:
id, start_timestamp, device_id
I am trying to get results of all start_timestamps within 5 seconds of a range of generated periodic timestamps.
For ...
13
votes
4
answers
4k
views
In the same query INSERT, can two VALUES being NOW() return a different time?
I met a query similar to
INSERT INTO mytable (id, Created, Updated) VALUES (null, NOW(), NOW())
having column definitions
| Created | datetime |
| Updated | datetime |
Will in this case MySQL ...
0
votes
1
answer
113
views
Querying the most recent records with two fields: datestamp and timestamp
I have a table called airquality that has records for air quality measurements taken on different days and times within those days. These date/timestamps are stored in two different columns: validdate ...
0
votes
2
answers
76
views
How to add time from a Date value to another without a varchar conversion?
Let's say I have 2 variables in a Stored Procedure, both are Dates
Foo contains '13/10/2019 00:00:00'
Bar contains '01/10/1914 16:33:11'
I want to add Bar's time to Foo's date, so that I get a ...
0
votes
1
answer
663
views
Row for each date, start and end
I have a table that has two columns, startDate and endDate. Each day has its own capacity. Between these dates, user can get from 1 to n items. I am going to get number of items remaining for each day ...
1
vote
1
answer
49
views
calculate days spent of all visitors from encounters
I have an encounters table
CREATE TABLE visitors(
id serial PRIMARY KEY,
start_date TIMESTAMP NOT NULL,
-- visitor_id bigint NOT NULL -- skip for now,
end_date TIMESTAMP
);
(end_date can be ...