I understand what you are doing, just one more thing. Can I use DATEDIFF(mm,Date, GETDATE()) <= 9 to make sure that I only get the last 9 months in the where clause.
Taking the entries for the month of September as the example of the results.
values (967652,1086346,2053998,'2010-09-20', 10765)
values (962932,1080301,2043233,'2010-09-13',0)
values (962932,1080301,2043233,'2010-09-06',5490)
Returned results:
"E", "M ", Month
4720, 6045, September
and so...
I'm trying to do calculation on two columns within the table.. (DDL for
creating and inserting test data below)
I need to get the difference between the last entry and first entry on the
columns "E" and "M" and it must be grouped by each month. I also need to
ignore the rows where the Total...
Sure... My stored proceure has a parameter titled "Values" and it's a varchar(max)...
My app developer is passing a string of values
Example: DAte, Name, Sex, Gender, Address, Zip
The stored procedure takes that list and creates a select statment with the parameter to return data. Reason...
I have a situation where I need to see if two certain values are being passed by my app developer via the variable that the stored procedure is using and if the values exists I need to create a flag for each one of them to execute the sp differently and remove the value from the variable.
Hope...
I have two tables that I need to use to create a specific select statement.
One table (AllData) contains approx 45 columns and data in each column. The other table (ColumnList) holds the names of the columns and a flag.
What I need to do is create a select statement against AllData that will...
Here is the DDL that creates the table and some dummy data:
CREATE TABLE [dbo].[Error](
[ErrorID] [int] IDENTITY(1,1) NOT NULL,
[CompanyID] [int] NULL,
[LayoutID] [int] NULL,
[PeriodID] [int] NULL,
[FileID] [int] NULL,
[ProductID] [int] NULL,
[TreatyID] [int] NULL,
[TempErrorTypeID]...
Thanks that worked...
However, the folder is going to have different files with different names and I need the specific filename of the file that starts with DI
Thanks
I need to retrieve the full file name of a file that resides within a specific folder. Currently I'm using this code
Dim FileLoc As String, FileName As String
FileLoc = "\\servername\FileLocation\"
FileName = System.IO.Path.GetFileName(FileLoc)...
Does anyone know how I can search the column names of all the tables in a database and see if any of the column names are using SQL Keywords.
I want get a list of the table and column so I can go to that table to rename the column.
Example:
A table name Test has a column named "Name", I...
I'm trying to develop a pass a guid from one table to another since I have to use the same guid for several thousand records, how can I do this? I can't find anything about this
How can I create an array based on a data filed, the field is a string. I'm using CR 9 with data from a SQL 2K Server. I've tried looking for an answer but couldn't find one.
I would like for the array to look like. Each record could have one or more records that need to go into the array...
Can someone help me with creating a dateadd statment that will return today's date three ago and at 11:59 PM
12/19/2002 23:59:59 is the final result
I have the syntax for the year part but not to get it to 23:59:59
SELECT DateAdd(yyyy, -3, CONVERT(smalldatetime, CONVERT(char(10), GETDATE()...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.