Skip to content
Advertisement

Tag: date

Grouping based on start date matching the previous row’s end date SQL

Hoping someone can help me out with this problem. I have the following sample dataset: MEM_ID CLM_ID ADM_DT DCHG_DT 1 111 01-01-2020 02-01-2020 1 112 03-01-2020 04-01-2020 1 113 04-01-2020 05-01-2020 1 114 06-01-2020 07-01-2020 2 211 01-01-2020 02-01-2020 2 212 05-01-2020 08-01-2020 3 311 02-01-2020 03-01-2020 3 312 03-01-2020 05-01-2020 3 313 05-01-2020 06-01-2020 3 314 07-01-2020 08-01-2020 I

Oracle SQL : how to specify Time Zone Region

Underlined, as hours are not specified, that means that hour is ’00:00′ I would like to specify that this is for Europe/Paris time zone region. Can you help me set-up this ? Thanks Answer A DATE data type has the components: year, month, day, hour, minute and second. It ALWAYS has those components and NEVER stores anything else (such as

SQL return rows on or after an specific date

I am trying to export a list of member details that have an expiry date after 2019 so I am just after I thought I could simply use the date in a WHERE clause However, it still returns the other entries and not sure why Answer Assuming that you are using SQL Server: dbfiddle

Create column with timeframe relative to other column in SQL

Suppose I have the following table t_1 where every row represents a day: How can I create the following table t2 from t1? Here val_cur is defined as the sum of values of the current timeframe (i.e. the sum of values between date_start and date_end) and val_prev is defined as the sum of values of the previous timeframe (i.e. the

Use one of two dates in where clause

I need to delete all records in a table where the CreatedDate or ModifiedDate is greater than x. The logic is as follows: If ModifiedDate is not null then use this value Otherwise use the CreatedDate value Not applying the if/else statement correctly. Answer Use this where clause:

Why is the return type of sysdate DATE? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 9 months ago. Improve this question Sysdate returns the current system date and time and its return type is of date. But shouldn’t date type only contain

Advertisement