1,382 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
3
answers
238
views
Unique constraint to prevent overlapping ranges? To make sure a BETWEEN statement for two columns will always only return one row?
We have two columns, id_begins and id_ends. We use a BETWEEN statement to select the row where a specific id number will fit between the values in those two fields (including the begins and ends ...
0
votes
1
answer
228
views
Use AND and OR within where clause for dates
I need to filter a collection of records that satisfies a single date OR satisfies a range of dates. How is this done in conjunction? For example, I need to filter records that has the date 02-FEB-24 ...
0
votes
1
answer
29
views
DolphinDB:Why does the semantics of pair different in different usage scenarios?
For example , for ( r in 1 : 6 ) { print r } returns "1,2,3,4,5 " ,excluding the right boundary .
However , between 1 : 6 returns true , meaning that " 6 " is inclued in the pair . Are ...
-1
votes
1
answer
110
views
compare the counts between two years
I am trying to report on comparing record counts between current and past years. I tried the samelastyearperiod function and the dateadd function, but I haven't had any luck. Can you please help me? ...
0
votes
0
answers
68
views
Snowflake join using between =incorrect values
I am using Snowflake, joining two tables using zip codes.
One table has a zip code , other has a value linked to zip code from - zip code to combination.
Zip codes go from all numbers to numbers and ...
0
votes
0
answers
27
views
Sorting between two years
My first error with this query was the year, and I fixed that by only adding quotation at the beggining and end of the years. That gave me a different syntax error with the ORDER BY. Any suggestions?...
0
votes
1
answer
43
views
Oracle SQL difference in days between two dates with different formats - SYSDATE and a VARCHAR2
I am trying to find the difference in days between a VARCHAR2 value (context sensitive) in format YYYY-MM-DD HH24:MI:SS and SYSDATE.
If I use in select
TO_DATE(peevf.screen_entry_value,'YYYY-MM-DD ...
0
votes
1
answer
24
views
Using Laravel query builder with Between and GETDATE
I'm trying to understand how I can create a query with query builder and have a where value something like
where item=1
and GETDATE() BETWEEN date1 AND date2
Thanks.
0
votes
3
answers
107
views
Redshift/Postgres between function produces seemingly unrelated error when ">" or "<" both work but not together
I am trying to filter out data that is stored as strings but represents numeric values.
I filter out non-numeric strings then convert to a float. I am then trying to filter values above or below a ...
0
votes
1
answer
85
views
How do I Join two SQL tables on Multiple date columns
My first table is Called Date_Table this has all the days of the year dating back to January 2020 and goes all the way to 31 Decemeber 2030.The data looks like this:
Date
Day
01/01/2020 00:00
Wed
02/...
0
votes
1
answer
903
views
AWS Athena: Why is it erroring " INVALID_FUNCTION_ARGUMENT: Invalid format: "" "?
Solved: The error was referring to empty or null values in the column that I had missed. On removing those rows the query works. However I still had to cast the query dates as dates, just using the ...
0
votes
0
answers
1k
views
Power Automate ODATA data Filter incorrect output (SQL Connector "Get Rows v2")
I have a problem when querying an MS SQL DB using the Power Platform SQL Connector. In the ODATA filter I have specified a date range (in the example between 1/1/2024 and 1/31/2024) and yet I get a ...
user avatar
user10346907
1
vote
4
answers
125
views
Return a default value in SQL even if the query return no result
For a very specific need for my application, in the best scenario, I must always retrieve an additional record preceding the date filter that the user selected.
Suppose in my database I have orders ...
0
votes
1
answer
109
views
Create a column in SQL that shows if specific month is between two dates
I want to add a column to the results, for every month. The column should contain true if it is between two dates (dates come from the same row).
For example I have date from = 2023年01月01日 and date to =...
0
votes
1
answer
227
views
CASE statement using between
I am playing the "lost at sql" game, specifically the "challenge CASE"
the problem requires to use the CASE statement to find put the "impostor".
The game gives guide ...