Its has been years since I wrote a curser and was hoping for some guidence.
Lets say I have a select statement that returns me a unique list of Customers
So here is the select
Trying to filter by current Month in a table. I know I can use the "m" but not sure what to replace it with.
I have a stored proc..and due to the structure of this proc...the wizard in Reporting Services cannot detect this as a dataset.
Does anyone know how I might rewrite this so SSRS will read it and …
I have a simple pivot query in SQL, which works in this format:
but does not work in this one:
because of getting error message:
The multi-part identifier …
I have a table of dates here are my column names
My second Table OnCallSupport here is a sample
I need 1 person from each team to be on call. How could you join these …
lets say I have a table called "billing" that has thousands of accounts and then inside the billing table there is a column called optionskey. the column optionskey can be anyone of 100 numbers. 4…
I have the following Store proc.
I would like to rewrite this so its not stuff the select statement into a variable.
I would like this to be just a select statement with the where clause logic …
does anyone have an application suggestion that will manage sql queries?
Hello there I am trying to create a recusion that creates an entry for a weekly start and end Friday to Friday
Getting this error
I have the below query that shows a list of tables and number of rows and total space in GB. This query works really well, however I would like to create a stored procedure whereby I can …
I'm not highly skilled in SQL, and my query isn't working, and I'd like to know what I'm doing wrong. I'm trying to write a query in MySQL to calculate a median. My logic is straightforward:
I need to create a sql query very similar to the one listed in this article.
However, instead of the results which are …
This is a little hard to explain but I will do my best. I need to write/update the example query below so that it will return the records requested, but also return records based on what was …
In SQL Server I call the following sproc, referenced by an SSRS report:
and get back a response of:
Command(s) completed successfully.
I don't get an returned rows.
Hi I've got a table setup with data like this below:
I want to be able to do a search on MED AND CDN but doing the AND isn't working. Only OR does. Is there a way to do that in MySQL? I just …
I have the following example data:
CustomerID CustomerDate CustomerCode
1 3/15/2017 ABC
This project still uses Visual Studio 2005 SQL Server Business Intelligence Development Studio and is doing some strange things.
I added a single column to an SSRS Report and get it working fine.
I have two identical tables both have 4 columns, lets say Column1, Col2, Col3 and Col4.
Now I need to get all records that exists in table1 and not in table2 by comparing all 4 …
I am using the RAISERROR WITH NOWAIT to view how my queries are executing and how much time is elapsing between individual statement blocks ... (short example below). Is it possible / or has anyone …
Hello, I have 2 tables and I need to update the results in tableOne with the results from tableTwo where the IDs match. My problem is, tableTwo can have multiple entries with the same ID, so I want to…
I need to add to the query below an IIF statement which will make EstShipCost $0.00 if products.localdiscontinued=true. By the way, InventoryProfile.EstShipCost is currently null if …
I have a query pulling date records and i would like to make report showing a grid type results. My original data pulls records based on a date, but I need all dates for the next 90 days. My query …
Is there a way to check all the Stored Procedures in a database and see if there are any errors in them ?
Like an ambiguous field when selecting or referencing an object that no longer exists, etc.
I have 2 tables, the first table (tblCarTypes) has 2 columns, CarTypeID and CarType. The 2nd table (tblCarRecords) has some records, where one of the columns is the CarType (which is populated with …
I am looking to extract a date from a notes box which will always appear after the # symbol. I have achieved this with the following line of code
SUBSTR (FINE_NOTES,(INSTR (FINE_NOTES, …