Hi,
The sql below creates a temporary table that populates numeric ranges, basically I can define a numeric range i.e. 0 to 200 and the number of splits i.e. 4, the query then splits the range into 4 intervals.
The split column is my split id, so I know which is the 1st, 2nd, 3rd interval and...
Thanks for the advice,
If I declare @compositeby as Decimal(10,1) then if set compositeby = 2 I get the wrong results.
The results I get are:
1a 0.1 2 4.8
1a 2 4 4.2
1a 4 5.5 3.5
1a 6 5.5 NULL
it should be:
1a 0.1 2 4.8
1a 2 4 4.2
1a 4 5.5 3.5
If the increment and compositeby are the same...
Hi,
I have a piece of sql that composites data to a specified interval (@compositeby).
If I want to composite the data in the table by a float value (not an integer) then I get an error.
In the code below the @compositeby is set as 2.5, but it gives me an error:
Msg 245, Level 16, State 1...
Hi,
I am using SQL Server 2005, I would like to know the best way to dynamically pivot data from a table using a table valued function.
In the code below I have an ID, TYPE, SerialNumber and SEQ column, I would like to pivot the data to give the following example:
ID 4145_1 4143_1...
Hi,
I have a normalised table called RESULTS, which contains water values.
I would like to pivot the values so there is a column for each type. I am able to do this with sql below and the result is:
ID Water_1 Water_2 Water_3
1A 0.01 0.01 0.01
1A 0.013...
Hi,
I would like to know how to amalgamate interval data using t-sql. The code below creates a temp table and I would like a query to amalgamate the intervals grouping by the field CODE,
I can use the sql
select id,min(INVFROM),max(INVto),code from #temptable group by id,code
but this...
Ok, this gives me a type mismach error.
Dim FilesToCopy
Dim sCopy()
Dim i
FilesToCopy = "file1.csv,file2.csv,file3.csv"
bPath = "C:\Temp\Test2\" 'DESTINATION PATH
aDate = CDate("01-JAN-2010") 'FILES CREATED AFTER THIS DATE...
Hi,Thanks
I tried the change and get the same error. I'm running the vbs from the command prompt.
The files to copy are stored in the array and passed through the loop to then be copied to the destination path 'bpath', where should I set the source path.
I tried the script below as well, but...
Hi,
I want to copy files from an array to a destination folder, I also want to check the date as well.
I tried the following script and get an error: Expected end of statement
Dim FilesToCopy As String
Dim sCopy() As String
Dim i As Integer
FilesToCopy =...
I would like some help with the following query.
The sql is designed to subtract 1 from the aplhanumeric value in the column ID and show the result in column [PREV_ID]
The combination of numeric and non-numeric characters can vary.
For example the prefix can vary like:
BD001
or
1234/01c...
Hi there,
The code below creates a table of data called ORIGTABLE, this table has a id column called ORIGID, that increments by 1, for example 'ID1_001','ID1_002 and so on.
I have another table called TESTTABLE, which contains an id column called TESTID.
The idea is that the user selects a...
Hi,
Is it possible to have sql return a comma separated list (string) of file names that exist in a folder.
This can be done using a batch command script or VBScript, it will be return the file names in a specified folder, but how do I incorporate this into an sql statement or sql sp.
Thank you
Hi there,
I am getting the following error when casting the date '24/08/2007 10:40:00' in the sql below:
select cast('07/04/2009 14:57:00' as DATETIME)
ok
select cast('24/08/2007 10:40:00' as DATETIME)
The conversion of a char data type to a datetime data type resulted in an out-of-range...
Hi,
This relates to thread thread183-1496513 which I am revisiting and need some more help with sql:
In the following code example I have a table of TEST id's that I want to composite into 3, so 1 composite is a combination of 3 test id's, this works fine. When I add the TYPE column to the...
Hi,
Is there a mathematical function or code in sql that will work out if a value is a multiple of 3. In my database a value entered into a column in my table can only increment by 3, so 3, 6, 9, 12.... is ok, 1,2,4,5,7....not ok
is there way of checking a value using a function.
Thank you
Hi,
This question relates to question: thread183-1545958
I have a dynamis sql statement that returns a view of results. I'd like to use the same statement in a table function, which I can pass the variable @type into.
When I constructed the function I recieved the error :
"An INSERT statement...
Hi,
I was able to build a dynamic sql script to query the data, I am passing the variable @type.
This is fine, but is it possible to use the script in a table function, I tried it and recieved the following error:
"An INSERT statement cannot contain a SELECT statement that assigns values to a...
Hi,
I am using sql 2005.
I would like some help with select data from 3 normalised tables, but dynamically.
I have 3 tables HEADER, RESULT and TYPE. The TYPE table is like a reference table for the NAME field in RESULT.
I want to select the results from the HEADER and RESULT tables but pivot...
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.