With the below test data I am trying to show how many sales have not been actioned by a colleague, an outstanding sale is any record that is still showing as “New”, I have been using the below to …
Tag: ssms
Query problem-getting wrong result when a condition or a set of data included
I have bug in my query, but I have no idea what happen. So there is 3 tables. table 1 name grade min max a b c d e table 2 fullname name min max a a123 1 10 bbbb b …
Date compare and difference
I have “Employee” table with employees’ “StartDate”. I want to get a list of all employees who are reaching their work anniversary next month. So far I have reached up to this point: …but this doesn’t seem to be working. Answer I want to get a list of all employees who are reaching their work anniversary next month. first you
How can I determined which users with a specific RoleID that’s not been active within a time interval? And which home department do they belong to?
This script below will tell me how many non active users with a certain RoleID there’s been within a timeframe. When I run the script below. It will also tell me which home department each user …
Can’t insert multiple rows in SQL Server Manager Express 2005
I have a Table HORAS_X with ID_HORA(int), ID_ZONA(int), DESCRIPCION(nvarchar), COMIDA(bit), META(int), NUMERO(int). I can insert a single row like: INSERT INTO HORA_X (ID_HORA,ID_ZONA,…
EDATE comparable in SQL Server? — Next Anniversary Date Calculation
Can someone help me figure out a formula to be used in SQL Server similar to the Excel formula pasted below? =EDATE(date,(DATEDIF(date,TODAY(),”y”)+1)*12) I want to capture the next anniversary date….
Why does this work under Microsoft SQL Server Management Studio but not under R?
I received this SQL statement: and it runs nicely under MS SSMS. The relevant part of the result is: When I run it under R I must leave out use MYDATABASE; and be sure I am connected at the right database, which is the case. But the SQL-statement is problematic. The output of: is data frame with 0 columns and
C# BulkCopy.WriteToServer Changing Values
I have a datatable that is created from and excel sheet. I am trying to SqlBulkCopy.WriteToServer. When I do so it converts my “Percent” value to 0 when my tables schema has type Decimal(38,0) for the “Percent” column. However, it inserts correctly when I have the Data Type as Float. I am not sure what is going on. I would
What’s wrong with this SQL CREATE + INSERT batch?
What is wrong with this SQL statement? Create table JaretsSchedule ( ScheduleID Int Primary Key NOT NULL, FieldID Int NOT NULL, HomeTeamID Int NOT NULL, AwayTeamID Int NOT NULL, …
How can i get a zero in front of the week number when it is a one-digit number?
I want to get the week number, and I did using DATEPAR(WEEK,DATE) , however, one-digit week numbers do not come with a zero in front. Basically I need to get 01, 02, 03 instead of 1, 2, 3.