Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
168 views

I am trying to alias a column based on a DateTime function in BigQuery. Below is my query snippet, SELECT SUM(CASE WHEN CAST(AsOfDate AS DATE) >= DATE_TRUNC(CURRENT_DATE,MONTH) ...
Jude92's user avatar
  • 167
1 vote
1 answer
632 views

I am trying to load a CSV file to my PGadmin database (on my local computer). I am running PostgreSQL16 with PGadmin4 as the user interface. I am trying to upload the date data as follows: UniqueID ...
akinoali88's user avatar
1 vote
1 answer
137 views

Suppose I have this two queries: SELECT * FROM payments WHERE created < DATE '1967-01-01' SELECT * FROM payments WHERE created < '1967-01-01' And created field is a date field. I would like to ...
Hey jude's user avatar
-1 votes
2 answers
96 views

I need to get the past 3 appointments and the next 3 appointments from a certain date. Each of these queries give the expected result. My problem is that I need the results together. I can't use UNION ...
Huerita37's user avatar
0 votes
1 answer
536 views

I'm quite new to SQL and I got stuck on one thing. Let's say that I have a database, where new records are being created every few mins and there is a 'dstamp' row which contains time when specific ...
Markvet's user avatar
0 votes
1 answer
590 views

I know about Snowflake date function to find out day, week, month, year, etc. I want to have weeks start from Saturday each week to next Saturday. following gives an idea how to extract, but need ...
Amir Ahmadi's user avatar
1 vote
4 answers
104 views

I have requirement to split column in 2 separate columns and then convert multiple date types column to standard date format column. CREATE TABLE Report (Id INT, Reference VARCHAR(30)); INSERT INTO ...
Yara1994's user avatar
  • 401
0 votes
3 answers
453 views

I am learning SQL and using Oracle SQL Developer. I have a table that contains the following columns FlightDate DepartureTime ArrivalTime I have inserted values using either TO_DATE('10:45', 'hh24:...
Vonec's user avatar
  • 13
1 vote
1 answer
669 views

I have below SQL which gives me count of files received in particular country according to date. But here dates are hard coded. I want them dynamically. I want it in such a way that whenever I run ...
AKHIL OMAR's user avatar
0 votes
2 answers
682 views

I need a solution to group the times of entry and the display the respective time interval and count of users/records during that time interval eg Time Interval Count 07:00 AM-07:30 24 12:30 PM-...
Gnanambal Meyyappan's user avatar
0 votes
1 answer
62 views

I want to send a post request to the rest API which includes an SQL date format, when I try to send the request with YYYY-MM-DD format, its showing bad request. How to properly send the data.
Bimal Sunil's user avatar
-3 votes
1 answer
400 views

I have a table containing two columns like this: Month_Date Year Dec 31 2018 May 01 2020 Jun 05 2021 Jan 18 2022 Jul 19 2019 I hope to combine the Month_date and year in the ...
Alice jinx's user avatar
-1 votes
1 answer
5k views

I am trying to extract the day of the week from a timestamp in SQL Server. I am specifically looking for the SQL Server equivalent syntax to EXTRACT. I want to count how many fields are in each day of ...
Rivky's user avatar
  • 1
0 votes
1 answer
387 views

We have a Stored Procedure in SQL Server which expects datetime column to be in MMddyyyy format and results in error Conversion failed when converting date and/or time from character string. ...
E_VAT_BIS_SOL Davean's user avatar
0 votes
1 answer
416 views

I have an excel from where I am bulk importing data to SQL server through .Net code (Dataset.WriteToServer method). Now, my excel has dates in m/d/yyyy format, e.g. 9/21/2021. The destination SQL ...
Bedabrata Bhattacharya IN's user avatar
1 vote
1 answer
181 views

I have a large table with time-series data for a whole year, with 24 values for each day (one per hour), for multiple customers. Customer-ID Date Value 001 2020-01-01 00:00:00 xx 001 2020-01-01 00:01:...
HealYouDown's user avatar
0 votes
1 answer
294 views

I am getting this syntax error when trying to insert a datetime into mysql database. pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds ...
vkan's user avatar
  • 123
-1 votes
1 answer
847 views

In one of my SQL Server tables, I have te following rows: Date Time 2021-10-01 10:00:00.0000000 2021-10-01 11:00:00.0000000 2021-10-01 12:00:00.0000000 2021-10-02 10:00:00.0000000 2021-10-02 11:00:00....
Pine Code's user avatar
  • 2,877
-1 votes
1 answer
136 views

I run this type of query every month and I have to change the month number manually for the current-running month. SELECT * FROM table_1 WHERE year = '[current month]' Is there any way I can ...
Sayyam's user avatar
  • 11
0 votes
1 answer
478 views

i have 2 tables who includes thes sames colums but the differentes data. TOOLS DATE ----------- ---------------------- A10MA17 2021-09-25 05:14:16.000 x10UA50 ...
Amenay Khial's user avatar
-1 votes
1 answer
765 views

When I try to run the below query I get no result even though the date time is same as that in the table. The BillDateTime column is of TEXT Data type SELECT * FROM BillingTransaction WHERE ...
kumar's user avatar
  • 9,731
0 votes
2 answers
309 views

I have a table which has different interval invoice. Please see sample data below: Invoice_Start_Date Invoice_End_Date Amount 1/1/2019 2/1/2019 12 1/1/2019 1/1/2020 ...
PythonDeveloper's user avatar
-2 votes
4 answers
1k views

I have the following table in SQL Server and would like to get the last and next appointments for each customer. Note: If the first appointment is in the future, last appointment should be N/A. ...
Vladimir Lenin's user avatar
1 vote
3 answers
2k views

New to SQL so sorry if this is a basic question. Looking to create a column that indicates a match in two dates (i.e. the date the record is created is identical to the date the record is expired). My ...
DrPaulVella's user avatar
0 votes
1 answer
1k views

I am trying to covert date value to datetime in SQL with the following query,which is resulting to invalid value: select convert(datetime,date_1, 25) from table1; date_1(of data type date): 2019-12-02 ...
Vineet Nair's user avatar
2 votes
2 answers
3k views

Hi I have two tables which I have to join on ID field and then on closest date ( only if the date is within one hour range more or less), the reason is both tables are not updated at same time so time ...
PythonDeveloper's user avatar
0 votes
1 answer
38 views

I need to find date ranges where status is Missing/Not Ready in all the groups ( Only the overlapping date ranges where all the groups have status of missing/notready) ''' ID. Group. Eff_Date. ...
PythonDeveloper's user avatar
5 votes
4 answers
12k views

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 ...
Eric's user avatar
  • 258
0 votes
2 answers
2k views

Is it possible to convert CST to UTC in MSSQL? For example: convert Thu May 13 11:14:19 CST 2021 to 2021-05-13 11:14:19.000
Derek's user avatar
  • 3
5 votes
3 answers
26k views

I have the following datetime column in my table "UpdatedTime" Sample value: 2021-12-31 00:00:00.000 I need to manipulate the hours, minutes and seconds to become 23:59:59 (i.e. a second ...
Wymo Oo's user avatar
  • 65
0 votes
1 answer
316 views

I'm a new in SQL and I'm trying to convert a column of type varchar(255) to datetime (yyyy-mm-dd). I found some advice to convert one element but how can I convert entire column to a new datatype? My ...
Duc Anh Ho's user avatar
0 votes
2 answers
488 views

I know there is a function to compare just the date of a datetime type column, but what if I want to only compare the time of it to another time. Is there a function in Linq To Entities? DbFunctions....
Mike Flynn's user avatar
  • 23.4k
1 vote
1 answer
57 views

I am working in Oracle live SQL with this same table with data for the whole year (in which the intervals can be larger). This is just an example(part of the whole table): I have to add two columns ...
Jakub Vlček's user avatar
1 vote
1 answer
472 views

I have been trying to figure out how to create a table out of this code, but can not figure it out. Thank You so much for any answers. WITH dat_param AS (SELECT SYSDATE AS dat FROM dual) SELECT ...
Jakub Vlček's user avatar
0 votes
3 answers
90 views

SQL Server CREATE TABLE [TABLE_1] ( PLAN_NR decimal(28,6) NULL, START_DATE datetime NULL, MAX_PERIODS decimal(28,6) NULL, ); INSERT INTO TABLE_1 (PLAN_NR, START_DATE, MAX_PERIODS) ...
Peter S's user avatar
  • 585
1 vote
1 answer
148 views

I am facing one problem for fetching records from table. My table look likes below:- id market_id opening_time closing_time day p_slot 1 1 06:30:00 ...
kunal's user avatar
  • 135
0 votes
0 answers
175 views

I am modifying a code snippet from a udemy course, to fit my goal. My goal - > being able to store the timestamps in a sqlite3 database corresponding to the actual time the data was retrieved. The ...
Sriram's user avatar
  • 1
1 vote
1 answer
697 views

Postgres will return TIMESTAMPTZ values using inconsistent formats, depending on how many zeros are after the . See these examples: 2020-10-24 13:21:05+10 2020-10-24 13:21:05.1+10 2020-10-24 13:21:05....
LaVache's user avatar
  • 2,719
-2 votes
2 answers
2k views

I have a table that consists of start and end dates and I need to need split records into day-wise and this needs to go in a View. | PersonID | CompanyID | Start_DT | End_DT | |-----------|--...
K.Tom's user avatar
  • 185
0 votes
1 answer
375 views

I have a table with a varchar column with different values in it. Some of the values in this column are in fact datetime stamp but written in varchar data type. I wish to find entries which contain ...
Iraj's user avatar
  • 389
2 votes
1 answer
89 views

In DB I have TIMESTAMP datatype like 17/06/21 12:33:47,879000000 and I would like to select in format 2017-06-21T12:33:47.879 Edit: I tried to_char(MODIFIED_TIME,'YYYY-MM-DD HH:MI:SS:FF') but getting ...
pqa1222's user avatar
  • 85
0 votes
1 answer
186 views

I have a table that looks like below: task_id start_date end_date t1 2020-05-01 8:00:00 2020-05-01 9:45:00 t2 2020-05-01 8:30:00 2020-05-01 9:00:00 ...
jesse1990's user avatar
1 vote
2 answers
2k views

This is the code in python that i am using below. But its not working and not showing any error. delquery = "DELETE FROM table1 WHERE date_column < date ('now', '-30 day')" conn.execute(...
user3030327's user avatar
0 votes
1 answer
2k views

How can I convert SQL smalldatetime or datetime like this: select cast(getdate() as smalldatetime) To JSON format like this: /Date(1576278000000+0100)/
hoggar's user avatar
  • 3,907
0 votes
2 answers
943 views

My table displays as below, |_______________|____________|_____________________|______________________| | ENTRY POINT | NAME | DATE OF ENTRY | DATETIME OF ENTRY | |_______________|...
hdhanarajan's user avatar
0 votes
1 answer
383 views

If I create a view today for a table that continuously keeps getting data, using date filtering from 1900 and 2100, for example, will that "copy" become truncated to the moment that I build the view ...
Eunito's user avatar
  • 446
0 votes
2 answers
1k views

I have a string like: 'SPY US 03/20/20 P45' I want to select just the date from the string. My current query is: Select Ticker, SUBSTRING(Ticker, PATINDEX('%[0-9][0-9]/[0-9][0-9]/[0-9][0-9]%',o....
PolarVortex8's user avatar
1 vote
1 answer
44 views

I've a database table as below: Sales Table id product_id for_date 1 10 2019-01-03 2 12 2019-01-05 3 16 2019-01-10 I want to get dates from between a custom date ...
Rajan Acharya's user avatar
0 votes
2 answers
91 views

Could use fresh POV help :) Need to show trips between midnight and 4AM. StartTime column is of type DATETIME. I already tried CAST(StartTime AS TIME) BETWEEN CAST('00:00:00' AS TIME) AND.... but ...
TommyD's user avatar
  • 27
1 vote
1 answer
242 views

I have epoch time values in Spark dataframe like 1569872588019 and I'm using pyspark sql in jupyter notebook. I'm using the from_unixtime method to convert it to date. Here is my code: SELECT ...
Peter MacLeish's user avatar