Showing posts with the label date

[FIXED] Generate a random date in Oracle with DBMS_RANDOM

Issue I have this anonymous block: DECLARE V_DATA DATE; BEGIN V_DATA := '01-GEN-2000&…

[FIXED] Full months difference

Issue create table mytable (id integer not null,date_start TEXT,date_end TEXT,wanted_full_month INT…

[FIXED] Take user input for number of months back and filter data based on that date

Issue I am working on a problem where I have to take user input which is an integer indicating the …

[FIXED] How to return only the Date from a SQL Server DateTime datatype

Issue SELECT GETDATE() Returns: 2008-09-22 15:24:13.790 I want that date part without the time …

[FIXED] SQL Add Lead Time Day to MAX Ordered Date

Issue I have a Material table and I want to retrieve the latest Received Date, Expected Date and Or…

[FIXED] How does postgresql identify if group-date (not register-date) has value in an existing column and return "0" or "1"?

Issue I wonder how postgresql query can generate a column, say 'has_alarm1', that will have…

[FIXED] SQL query to return percentage of rows where binary variable equals a value, by month

Issue I need to run a query that returns the % of rows where the Type column is equal to "Yes&…

[FIXED] SQL convert date to yyyy-mm-dd

Issue How would you convert a date in the format of: 2012-10-16 07:44:22.000 to this format: …

[FIXED] MySQL where clause with DATE_FORMAT

Issue I have a MySQL table with a date column. I am trying select all the rows between some parti…