I have the following table as my input: Date | Agent Name | Agent Department | Call ID | Transfer? | TransferToAgent_Dept ————————————————————————…
Tag: sql
Select Distinct and sequence at the same time
How can I able to use Distinct on select statement along with a sequence on SQL Server I try this sub-query but no luck I get error of NEXT VALUE FOR function is not allowed in check constraints, …
Use PATINDEX to extract a substring in SQL Server?
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….