I have 4 tables ProjectTable projectid: INT (pk) modifiedDate: DateTime2 … ProjectFinalizeTable id: INT (pk) projectid: INT (fk) modifiedDate: DateTime2 … ProjectAdditionalTimeTable id: INT (…
Tag: datetime
List values with MaxDate
Im trying to create ie query to show itens with MAX DATE, but I donĀ“t know how ! Follow the script and result: I need to show only tasks with the last date of each one. Can you help me ? Answer You seem to be using Postgres (as suggested by the use of casting operator ::). If so –
Minimum of Days Difference between Dates and Update PostgreSQL
I have a situation like, I need to find out which record is having minimum difference of days between atleast 2 dates. Like – Table Data is like Input Parameter : [aDate = 12-Nov-2020, Infold = 2] Result should be: Need to find the date difference between the input dates and existing dates, find the record which is having minimum
Aggregate data based on unix time stamp crate database
I’m very new to SQL and time series database. I’m using crate database ( it think which is used PostgreSQL).i want to aggregate the data by hour,day ,week and month. Unix time stamp is used to store the data. following is my sample database. i tried the sql query using FROM_UNIXTIME not supported . please help me? im looking the
Postgres SUM over given time
I am trying to SUM google analytics data over a given time using Postgres. I am not quite sure how to get around a grouping issue. The query you see below returns one column per day. I want to SUM all …
Get rows with a condition
Each customer can have one or multiple accounts (account_id) How can I get max closed_date for the customers who closed all their accounts and the rest of the active customers?* *active customers are …
Define two or more conditions into a stored procedure with inner join?
First, I needed to filter the data from the tables TbTaxCompanies and tbCompany, through the variable @company_id… and works! And second I need to filter again the set of logs from the company selected previously with @company_id, but now to obtain only the latest updated taxes (only one row)… and this DOES NOT WORK! I really appreciate any help. Answer
How to convert char data type to date in SQL Server?
In a table, there is a column BeginDate of type char(10) and all the records are saved in 2020/05/06 format. How can I change the data type to Date? Answer You could strip the / characters and then you have the ISO format yyyyMMdd.: But the real solution is fix your design; stop storing dates as a varchar.
Select max value for each company in list, display longest value per company per day
I’ve looked at some of the other questions similar to this, but nothing I’ve found can quite get me there. I have a table with multiple columns, but 3 of the columns are Company, Date, and WaitTime. I want to select the longest WaitTime for each company and for each day. I’d like to display the results for the entire
group by date and two different times in the same date in Sql
i want to select from my database the data that is BETWEEN to date and two different times in the same date but when I use the Sum in one of the variants it give me a wrong result i thnik that the …