Skip to main content

Questions tagged [date]

Questions related to date or date-related functions, data-types, representations (how dates might be stored and displayed) and operations (such as subtracting dates, adding intervals to dates).

Filter by
Sorted by
Tagged with
0 votes
1 answer
43 views

Postgresql giving different result when comparing timestamp with date in different time zone

When running the following query, I would expect it to give the same result independently of the session time zone but instead it gives different result depending on the session: select '2025-09-22' &...
vgfeit's user avatar
  • 15
0 votes
1 answer
35 views

SQL Loader rejecting date: column not allowed here When importing date

I am trying to import a file using SQL Loader in Toad and am receiving an error message "ORA-00984 column not allowed here". I previously was getting an error message that there was a non-...
Stephanie's user avatar
0 votes
1 answer
52 views

Convert Oracle date column to timestamp with time zone

How can I convert a Oracle DATE column to TIMESTAMP WITH TIME ZONE without losing the content of that column?
BuZZ-dEE's user avatar
  • 131
6 votes
3 answers
717 views

Unexplained MSSQL default date formatting

I have a problem with T-SQL that is out of my control. Their T-SQL is failing to work with a date that was cast to VARCHAR(10). They are expecting to get the default yyyy-mm-dd (the documented default ...
Patrick's user avatar
  • 163
2 votes
1 answer
351 views

Loading a CSV into mariadb errs out as "invalid date format"

I am trying to load CSV into a MariaDB . Having issues in transforming date . Here is an example file and two tables ( emp , where dob is declared as a date column and emp_varchar , where dob is ...
Z.DBA's user avatar
  • 21
8 votes
2 answers
2k views

Is an invalid date considered the same as a NULL value?

I am using MySQL 5.7 and I have notice something which I cannot explain to myself with my current knowledge so here it goes. Is an "invalid" date 0000-00-00 considered same as NULL for a ...
ReynierPM's user avatar
  • 1,888
-2 votes
1 answer
77 views

Why is it selecting date from another month that requested one? [closed]

I have a table that store time begin and time end of some events. I want to search in this table all even that were occuring during specific day. Here is example data: Id Date begin Date End Name 1 ...
Elikill58's user avatar
  • 181
0 votes
3 answers
155 views

what's the bests practices in date

What's the best practices with a date field when you want to fill in the fact that it's not filled in and not leave it NULL? should you put 1999-01-01, 9999-09-09, 1890-12-31...? Are there any rules ...
pasqal's user avatar
  • 113
1 vote
2 answers
297 views

How to generated missing dates between date range that do not exist in the joined table in CockroachDB?

I have Table A and Table A which have Table A id, start_date, end_date Table B id, table_a_id, archive_date I want to return the dates that are missing in Table B, the dates that are NOT in the ...
Brunaldo's user avatar
0 votes
1 answer
148 views

How to generate most recent nth day of the month?

Simple question, but I haven't found any examples of this on Stack Exchange: I need to be able to select all records in the current billing cycle, that's it. The catch is the billing cycle doesn't ...
InterLinked's user avatar
0 votes
0 answers
92 views

Complex day-to-day difference of historical data in SQL server

Setting: I have a table (let's call it "HistoricalData") with 10 attribute columns, a date (in string format) and a value. The table has a unique clustered index on (date, idcol1, idcol2,.....
101001000100001's user avatar
0 votes
1 answer
36 views

I am getting an infinite fetch duration when adding a similar third left join

I am using MySQL on Windows 10. The query below should result in three groups of data sets that are different only in the date range. It works for any two date ranges but when I try to run all three ...
Mathly's user avatar
  • 1
3 votes
5 answers
3k views

Optimizing SQL Server Query When Joining Tables on DATETIME column

I am working with SQL Server and I have two tables, table1 and table2. Both tables have a DATETIME column denoted as dt. I need to join these tables based not only on certain conditions but also to ...
Fajela Tajkiya's user avatar
1 vote
2 answers
78 views

TSQL count 2 different columns by using number table

I am trying to count 2 different date columns on a monthly interval by using a number table: numbers table: num 0 1 2 3 Originating Table (Example): Gender Subscription_Date Cancel_Date male 2023-01-...
RaGe's user avatar
  • 13
0 votes
1 answer
146 views

How to join matching Date fields as intervals?

Let say I've a table with a list of id/year/month (two years + 24 months for semplicity here): Code Year Month MAT000000001 2022 1 MAT000000001 2022 2 MAT000000001 2022 ...
markzzz's user avatar
  • 243

15 30 50 per page
1
2 3 4 5
24