I am trying to create simple requirements management database. Basically I have 2 tables like below: Contract_requirements with 2 columns: CR_ReqID | Description reqCR1 | Contract req …
Trying to loop a query to get monthly counts
I need to get the number of employees who had active coverage for each package, per month. Looking at a span of 50 months, so don’t want to run it 50 times. I need the number of people with each …
Get count of records changing status
I am trying to figure the best way to get a count of how many times a record was sent back to the user (Status changed from 3 or 4 back to 1) this is what my data looks like ID record_id …
SQL – How to get the percentage of 2 sums
I am trying to get the CTR from uploads to clicks. How would I be able to get this percentage? I am currently using the code below and I receive 0 as a result (view attached img). SELECT …
Joining two tables, one of which containing the other
I am new in the SQL world (my problem might be very easy to solve). Also,I work exclusively on Access. I’m french and I realise that it is hard for me to explain so I’ll give you a demo after. I have …
SQL SSRS How to drill down State into top three cities. Do I do it in SQL or SSRS?
I am creating a simple report where I have a location (down to the city level) and some information about that city in regards to my customers. Here is what the table look like Now what I want to …
SQL statement not appending to temporary table
To export displayed user data from a form to excel I create a temporary table and export that table. Normally this works however, in the case where I need to Query two different tables and export them …
How to do like compare on case sensitive string
select http_host,user_agent,date,path, count(*) FROM “public”.”bus_request” where app_name = ‘yyyy’ and event_type <> ‘browser_js’ and date <= GETDATE() and date>= GETDATE()-14 and …
Fade in SQL results with jQuery
I have a php file that I have pulling in SQL elements from my database. My goal is that for each row of data that the div ‘moredetails’ would fade in on click (one at a time). However, the current …
How to count the number of orders and the number of returns from same order id?
I’m trying to derive a table as CustomerID, OrderCount and ReturnCount from a table with columns as CustomerID, OrderID, ReturnFlag I’ve tried the following code that gives me 2 distinct tables but I …