I have some specific values I want to extract out of a string in SQL Server, but I’m not sure exactly how to get it done with PATINDEX. Take this string: declare @Command nvarchar(500) = ‘IF dbo….
How do I get the most recent processdate in a group?
I’m wanting to get the most recent entry per month using acct.processdate. I’ve tried using the MAX() function, but it doesn’t help since I am using group by. How do I go about doing this? DECLARE @…
How do you use VBA to make a form jump to the nearest future date in Access?
I’m trying to get an MS Access database to open a form either to today’s date if it’s in the date field in the database, or the nearest date in the future. I tried the code here, but it doesn’t work. …
Issue using to_date giving ORA-01722: invalid number
I am trying to pull together two fields to create a mm/dd/yyyy date field using case-when, and it keeps giving me error ORA-01722: invalid number. Answer The problem is Oracle applies the concatenation operators before it does the arithmetic. So the ELSE branch of your CASE statement: is going to execute someā¦
Grouping the rows by similarities
I am working on SQL server. I have the following table: For each BIGroup I have a multiple VarianceName. For each VarianceName I have multiple PartNumbers. I am comparing every partnumber with the …
How to get the primacy of a function for an employee?
I have this following query to get all the functions and the related scopes (companies) for an employee : SELECT * FROM employee_scope WHERE EmployeeId=54 Output : EmployeeId FunctionId …
How to Join Tables on Datetime within a margin of seconds
I have 10 tables: Table1, Table2, …, Table10 Each one with the columns: id text datetime My task is to join the Table1.datetime with the rest of the 9 tables.datetime (+-3seconds on the 9 tables)…
Which the best way to use inheritance of tables in postgreSQL?
i want to use inheritance in my database (PostgreSQL) so i wrote this code but finally i found there are inherits in PostgreSQL CREATE SEQUENCE public.user_account_id_seq; CREATE TABLE public….
PostgreSQL result of first query used in second query
Sample Data: |lastmodified|Number1|Number2|password_mod| |2020-01-25 |250000 |100000 |true | |2020-01-26 |250000 |200000 |false | |2020-02-01 |300000 |200000 |false | |2020-02-…
get only unique record before grouping
I have this table named votes, this table might consist of duplicate records with these columns business_id and user_id. I created a view that will display the count of votes per business but …