Viewing 15 posts - 7,681 through 7,695 (of 8,731 total)
I'm not sure on how would you manage to use a view if you want to use parameters. You could certainly use a lookup table, but the function I posted...
September 24, 2013 at 8:26 am
You should take a look at this article.
How to Make Scalar UDFs Run Faster[/url]
Here's an example on what you could do.
CREATE FUNCTION dbo.tf_Points(
@Grade AS VARCHAR(10),
@Type AS INT
)
RETURNS TABLE
AS RETURN
SELECT...
September 23, 2013 at 4:56 pm
That's because you can't use a value from a SELECT, outside the SELECT. To assign the value is easier than you might have thought.
Declare @ratecodeVar varchar(15)
SELECT @ratecodeVar = COALESCE(NULLIF(over_rate2,''), NULLIF(over_rate,''),...
September 23, 2013 at 2:52 pm
The problem is that you can't store a value larger than 24 hours as time. You could use a workaround but you need to be sure to manage the string...
September 23, 2013 at 8:12 am
What about using ROW_NUMBER?
WITH CTE AS(
SELECT
SCHEMA_NAME(t.schema_id) AS schema_name
, t.name AS TableName
, i.rows
, c.column_id AS NumberOfColumns
, ROW_NUMBER() OVER( PARTITION BY t.name ORDER BY c.column_id DESC) rn
FROM
sys.tables t...
September 20, 2013 at 9:40 am
All I understand would be something like this.
UPDATE #temp SET
Princ_Adj = ( Princ_due + Int_Due + Other_Due) - Collection ,
...
September 20, 2013 at 8:52 am
Let's make his life easier with this link.
September 20, 2013 at 8:37 am
You need to use the IFCode tags that you can find to the left of the post editor.
For SQL Code, you need [ code="sql"][/code] (without the space between the bracket...
September 20, 2013 at 8:35 am
Put parenthesis aroud the subqueries that will form your datasets.
September 19, 2013 at 2:16 pm
There might be something wrong in the configuration of Powerbuilder (I've never used it). The variables are wrong as well (there's a : where a @ should go).
September 19, 2013 at 12:32 pm
Does it fails if you change the syntax like this?
CASE
WHEN @MonthUnits = 1 THEN GBAN01/100 -- January
WHEN @MonthUnits = 2 THEN GBAN02/100 -- February
WHEN @MonthUnits = 3...
September 19, 2013 at 12:12 pm
I'm sure you're not using SQL Server, but I guess this should work as expected.
SELECT labtrans.transdate,
labtrans.laborcode,
labtrans.regularhrs,
labtrans.startdate,
labtrans.craft,
labtrans.refwo,
task.worktype,
task.parent,
parent.wonum,
parent.location,
parent.worktype,
matusetrans.itemnum,
matusetrans.mrnum,
matusetrans.transdate,
matusetrans.actualdate,
matusetrans.issuetype,
matusetrans.description,
matusetrans.storeloc,
matusetrans.refwo,
matusetrans.linetype,
labor.personid,
matusetrans.issueto,
asset.eq1
FROM labtrans
JOIN workorder task ON labtrans.refwo = task.wonum
JOIN workorder parent ON task.parent = parent.wonum
JOIN labor...
September 19, 2013 at 9:55 am
Not exactly a bug, it's just the accuracy for datetime data type.
You can read about it here.
http://technet.microsoft.com/en-us/library/ms187819%28v=sql.105%29.aspx
September 19, 2013 at 9:23 am
I'm glad that we could help.
After a while we all start looking for the simplest way to do it. 🙂
September 19, 2013 at 9:14 am
Have you tried using the view INFORMATION_SCHEMA.COLUMNS?
It might have the information you need to compare.
September 19, 2013 at 9:02 am
Viewing 15 posts - 7,681 through 7,695 (of 8,731 total)