sql-date-functions Questions

8

I'm trying get the results where it only displays OrderDates before the LAST day of the CURRENT month. I'm guessing it would be like this... SELECT OrderDate FROM Orders WHERE OrderDate < (code...
Beckman asked 25/3, 2014 at 1:43

4

Solved

In the docs I could only find a way to create a date from a string, e.g. DATE '2000-01-02'. This is utterly confusing and annoying. What I want instead is a function that takes three parameters, so...
Consider asked 10/3, 2013 at 1:12

4

Solved

What I am trying to do is take a date in SQL Server and find the last possible hour, minute, second, and millisecond of that date. So if the date is this: 2021-02-16 13:08:58.620 I would like to re...
Selie asked 7/6, 2021 at 20:31

6

Solved

I have the query below where the date is hard-coded. My objective is to remove the harcoded date; the query should pull the data for the previous month when it runs. select count(distinct switch_i...
Pythagoreanism asked 11/9, 2012 at 18:38

3

Solved

I have a String String s = "01 NOVEMBER 2012"; Then I want parse it to sqlDate. And insert it into the database. Is it possible to parse that string to sqlDate?!?! Yup, sql date format is "yy...
Glennisglennon asked 11/10, 2012 at 16:13

10

Solved

I am looking for a way to implement the SQLServer-function datediff in PostgreSQL. That is, this function returns the count (as a signed integer value) of the specified datepart boundaries crossed ...
Squeaky asked 24/7, 2013 at 11:49

5

Solved

I want to perform a query which would look like this in native SQL: SELECT AVG(t.column) AS average_value FROM table t WHERE YEAR(t.timestamp) = 2013 AND MONTH(t.timestamp) = 09 AND DAY(t.tim...
Rhoea asked 16/9, 2013 at 11:28

4

How do i get the date for last friday of the month in T-SQL? I will be passing the year and month as parameter,e.g, 201211. If I pass '201211' as parameter it should return me '20121130' as answer...
Sowell asked 21/12, 2012 at 10:45

4

Solved

I have an orders table which contains an order ID, order date and order description. I want to run a select query which captures all orders that have been created in the last two days. so the curr...
Tinnitus asked 14/12, 2017 at 16:41

2

I know that Gregorian calendar started on Oct 15th 1582, and during the transition from Julian calendar, 10 days had been dropped. When I'm doing this query: SELECT STR_TO_DATE('1582-10-05', '%Y...
Hypesthesia asked 23/11, 2017 at 18:1

1

Solved

I want to get first and last dates of current month (Like 30th or 31st).How to get this one by using postgress sql query.
Malisamalison asked 14/4, 2017 at 7:30

1

How can I convert a column with a date e.g. '2012-08-03' to the day of year in Postgres?
Meunier asked 3/9, 2015 at 14:58

1

I'm creating a table B from an exisitng table A. In the table A I have a column ValDate which is varchar and contains Date. When I try to create the table B I have a function used in the query as g...

2

I am trying to get the total amount of registered users per day. At the moment I am using this: $sql = "SELECT name, email FROM users WHERE DATE_SUB(NOW(), INTERVAL 1 DAY) < lastModified&qu...
Ormiston asked 26/3, 2013 at 9:37

3

What is the difference between curdate() and current_date in MySQL?
Taciturnity asked 6/1, 2014 at 6:46

2

Solved

I am trying to carefully and meticulously clean up some of my older (production) code. One thing I am trying to do is convert all my usages of java.util.Date to LocalDate and DateTime. However, I ...
Acidulant asked 23/12, 2013 at 3:4

1

Solved

Im trying to execute the following SQL query and filter out the data based on the date. I need to display a table which filters out the data such that, only those rows which are between the mentio...
1

© 2022 - 2024 — McMap. All rights reserved.