Viewing 15 posts - 5,161 through 5,175 (of 15,381 total)
I am sure that your desired output makes perfect sense to you. Unfortunately we don't know your business rules and what you posted does not help clarify what you want....
April 17, 2014 at 8:16 am
I am not sure that your cursor actually works in all cases. When running it as is the values for ID 7 seems to be accurate. If you add a...
April 17, 2014 at 8:07 am
I still don't understand your desired output. The formatting from this site doesn't help either. 😉 You probably need to create a temp table with your desired output so we...
April 17, 2014 at 7:37 am
Take a look at the documentation for MERGE. http://msdn.microsoft.com/en-us/library/bb510625.aspx
Look closely at the OUTPUT clause. You should be able to utilize that for what you need.
April 16, 2014 at 3:15 pm
J Livingston SQL (4/16/2014)
Seanthe following works,,,just left out the "QuantityChange" column (don't think its relevant to the question)
Cool. Now if we can find out what the question is we can...
April 16, 2014 at 2:48 pm
The script you posted should work assuming the values are within acceptable values for each datepart. As much as I hate to say this I think you may have to...
April 16, 2014 at 2:46 pm
Your inserts do not work. There are more columns specified than values provided.
Also, what are you looking for as output based on this sample data?
April 16, 2014 at 2:02 pm
To the OP - Hi and welcome to the forums. In order to help we will need a few things:
1. Sample DDL in the form of CREATE TABLE statements
2. Sample...
April 16, 2014 at 1:58 pm
miles_lesperance (4/16/2014)
In your WHERE clause, you could try:WHERE DATEPART(dw, getdate()) in (2, 3, 4, 5, 6)
That should give you only weekdays.
That doesn't really capture what the OP is looking for....
April 16, 2014 at 1:57 pm
Your case expression will handle any rows with a NULL but you obviously have some data in there somewhere that cannot be cast to a datetime. Maybe you need...
April 16, 2014 at 1:33 pm
miles_lesperance (4/16/2014)
SUBSTRING(a1.Field1, 3, 2) + SUBSTRING(a1.Field1,5,2) +...
April 16, 2014 at 12:34 pm
OK so let's pretend you are going to run this with the sample data you provided. You said the value for the parameter would be 25%. Given that value, what...
April 16, 2014 at 11:02 am
daniness (4/16/2014)
This is the query:
SELECT ISNULL(ath_stlmnt_instr_id, ae.stlmnt_line_instr_id) AS ath_instr_id
,ath_instr_id AS orig_instr_id
,ath_gl_num
,ath_cost_cntr
,CASE
WHEN ath_postype = 'GLD'
THEN sum(ath_usdamt)
WHEN ath_postype = 'GLC'
THEN sum(ath_usdamt) * - 1
END AS ath_usdamt
,count(*)
FROM dbo.ACCTING_TRANSACTION_HISTORY
left join Accting_body ae...
April 16, 2014 at 10:42 am
daniness (4/16/2014)
Thanks for the suggestion. However from what has been posted here earlier, the fields in both Group By sections need to match. I tried it, nonetheless,...
April 16, 2014 at 10:08 am
rash3554 (4/16/2014)
But how would I insert into employeeaddresses table? Can I have 2 table valued parameters as input to a procedure is my question? one to insert empaddr_verified using...
April 16, 2014 at 9:34 am
Viewing 15 posts - 5,161 through 5,175 (of 15,381 total)