SELECT
PC_COMP_CODE,
'R',
PC_RESUB_REF,
DECODE(PC_SL_LDGR_CODE,'02','DR','CR'),
PC_DEPT_NO DEPT,
'',--PC_DEPT_NO,
PC_SL_LDGR_CODE+'/'+PC_SL_ACNO,
SUM( DECODE(PC_SL_LDGR_CODE,'02',1,-1) *PC_AMOUNT),
PC_CHEQUE_NO CHQNO
FROM GLAS_PDC_CHEQUES
WHERE PC_RESUB_REF IS NOT NULL AND PC_DISCD NOT IN ('d','D','T')
GROUP BY PC_RES...
Hi,
I am using VB.NET for coding and SQL Server 2005 for database.
My application is ready for release. Just on thing missing before I can go live.
I want to implement license concept in my application.
My license file can be text or xml file. In which there should be some encrypted matter which will be used for validate the applicat...
Hi,
I'm looking for the best method for importing csv or excel file to SQL Server 2005 using .net MVC.
Thank you.
...
I'm looking for an elegant way to convert a field of type varchar, with variable data in it, to a data type which can be used for mathematical operations sample data from the field
(excluding quotes)
''
'abc'
'23'
'23.2'
The method should work for all, and for the first & second values should return 0, and not throw an SQL Server err...
Using SQL 2005: “Taking too much time to execute”
I want to filter the date, the date should not display in holidays, and I am using three tables with Inner Join
When I run the below query, It taking too much time to execute, because I filter the cardeventdate with three table.
Query
SELECT
PERSONID, CardEventDate tmp_cardevent3 ...
I have a table with a heavy load(many inserts/updates/deletes) in a SQL2005 database. I'd like to do some post processing for all these changes in as close to real time as possible(asynchronously so as not to lock the table in any way). I've looked a number of possible solutions but just can't seem to find that one neat solution that fee...
I am working with the following query.I want to use Date_Sent_to_Recorder in my other calculations which follows.I am getting an error "Invalid column name 'Date_Sent_to_Recorder'." People recommended using a CTE for this but i am not able to fit it in this scenerio.I have a correlated subquery which calculates Date_Sent_to_Recorder.Plea...
Hi folks,
I've used the sql from this article http://blogs.techrepublic.com.com/datacenter/?p=275 to try and track down the cause of a lot of blocking which has been going on recently within my sql server 2005 database. A number of times, all the processes returned are calling 'create function...', the functions vary but a number of the...
I like to use SQL Server 2005 templates to run frequently used queries. You can include parameters in your templates using this syntax:
<LastName, varchar, 'Bob'>
I have a query that needs the less than or equals to operator <= but unfortunately the SQL Server 2005 template interprets that as the start of a parameter. I have been unab...
I am using SQL Server Reporting Services 2005, and I'm developing a report in Report Designer/Business Intelligence Studio. Right now I have a normal-looking table that displays data like this:
----------------
| A | B | C |
----------------
| A1 | B1 | C1 |
----------------
| A2 | B2 | C2 |
----------------
| A3 | B3 | C3 |
--------...
I need to calculate a median on a set of data, so I created a temp table and have tried to follow some articles online with zero success, here is what I am working with:
CREATE TABLE #QuizTemp (QuizProfileID INT,Cnt INT,TotalScore INT)
INSERT INTO #QuizTemp
SELECT QuizAnswers.QuizProfileID, COUNT(QuizAnswers.QuizProfileID) AS Cnt, SUM(...
I'm using SQL Server 2005 Analysis Services and I'm trying to calculate distance inside of an MDX query - so that I can get counts of the items that are near my current location. I've created a dimension with Latitude & Longitude, and have also created a .NET assembly to do the math - but am having a hard time getting it all to work out...
I have a webconfig file which has a connectionstring in it...
But then when ever i access a database i have to write the same connectionstring again and again... is there a way it can take the value of the connectionstring from the webconfig file itself..????
System.Data.SqlClient.SqlConnection dataConnection = new SqlConnection();
...
I have a report which needs to total up the number of registrations per week, over the last ten weeks and display it as
"Week Ending October 10th, 2009" 500"
"Week Ending OCtober 3rd, 2009" 400"
"Week Ending September 26, 2009" 1000"
etc...
Here is my query:
SELECT Count(*) as [Total]
,Week = DateAdd(day, -1 * da...
I have a DateTime column in my Time dimension table. I want to display this as just MM/DD/YYYY and hide the time component (which is 00:00:00 anyways).
How do I do this?
...
i need to start at a year-month and work out what the date it is in a given week, on a given day within that week..
i.e
year: 2009
month: 10
week: 5
day-number: 0
would return 2009-10-25 00:00:00 which is a sunday. Notice week 5, there is no day 0 in week 5 in 2009-10 as the sunday in that logical week is 2009-11-01 00:00:00... so w...
I have a inline select statement to calculate the product of the set of values.
Since SQL Server 2005 doesn't have a built in Product aggregate function, I am using LOG/EXP to get it.
My select statement is:
(select exp(sum(log(value))) from table where value > 0)
Unfortunately I keep getting the following error:
Msg 3623, Level 16...
Hi
Two table are tied with each other because of FK constraint. I am trying to update these tables by disabling ALL Trigger but still getting the following error :-
The UPDATE statement conflicted with the FOREIGN KEY constraint "FK_TEST_REFERRING_REFPHYSI". The conflict occurred in database "ccdb", table "dbo.RefPhysician", column 'R...
Hi, I'm trying without luck to create a modify() statement to change the value of an attribute in all elements that have that attribute value -- so far I can only get it to change the value in the first matched element. I created an example below of what I have so far, which I'm running in SQL Server 2005:
DECLARE @x XML
SELECT @x = '
...
Hi
I dont have any idea why am i getting this error :-
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
The statement has been terminated.
I was trying to run this query:-
ALTER TABLE Test1 NOCHECK CONSTRAINT ALL
ALTER TABLE Test2 ...