Thanks for your help but the http://vyaskn.tripod.com/code/propercase.txt
will not work for what I'm trying to do.
I can't use a function. I can only use a select query that will manipulate the data.
I've looked through the links everyone put up and the posts don't match what I need to do.
I am changing the value on the front end by using a merge field. But I have to write a select query that will change the data and then when the user pulls the report the data will display correctly.
Our...
I'm trying to create a query that will display our database field with Upper and Lower case (currently the data is saved as all Upper case).
So for vchBusinessName = ARROW PLUMBING AND SERVICES, INC.
I want it to display = Arrow Plumbing And Services, Inc.
I've created this query:
SELECT...
I have not created many insert statements and I'm not sure how this one should be coded. Please help.
I need to insert a record based on a select query that will give me a record set of what needs to be inserted.
select query will give me intCaseID from tblCase.
12345
23456
34567
Then I...
Ok I've revised my UPDATE query, any input would be really great:
UPDATE tblBankAccount
SET
bank.dteClosed = maxDate.DateClosed
,bank.intDontPostInterest = 1
,bank.vchEditedBy = autoBAClose
,bank.dteEdited = GetDate()
FROM tblBankAccount bank
INNER JOIN (
SELECT C.vchCaseNumber...
I have a Select Query that I have tested and is pulling the results I want, now I need to create an UPDATE statement and I'm not sure how to with a MAX involved in the update. Please help!! I'm not familiar with writing UPDATE stmts. Thanks in advance.
SELECT STATEMENT
SELECT...
I need help I have a very long query. That I know could be written better and more efficient but, I'm not sure how.
The query works except for in the First Select Stmt, it wont let me include the ORDER BY (I put *** by it).
Someone suggested for me to user the feature of CUBE, but I have to...
I've created a very long and complicated Derived Query in order to Combine Two Queries and but my problem is its not giving me the correct results. My extremely long query is below, but here are my results and then I'll show you what I need it to do. Thanks in advance for any help!
First of...
You're right the 1/1/1900 is a default in our system that the field doesn't have a date value set. The null value thats returned will act as the same for me in this situation.
Thanks for explaining about why you used the Left Join instead of Inner Join.
Hopefully I'll be able to use this...
Your code works perfect. I'll have to troubleshoot it with every scenario, but it looks like exactly what I need.
I think I follow the logic, I just didn't know that could be done.
The select COALESCE part is naming the two values i want pulled (first column dist.dtePosted if not null it'll...
OK first this query needs to be runned and produce a value if there is a record in tblDistribution that meets the parameters.
SELECT TOP 1(d.dtePosted) FROM tblDistribution d
WHERE d.intDELETED = 0 AND d.intPosted = 1 AND d.intCaseID = @intCaseID
If there was not a record in tblDistribution...
Ok
For lets say b.intCaseID = 1
in tblDistribution there's a row that meets the criteria of intDeleted = 0 and intPosted = 1, so it should pull the tblDistribution.dtePosted value of 1/1/2007
For lets say b.intCaseID = 2
in tblDistribution there are no rows for intCaseID = 2. So I want the...
I rewrote it another way and I'm still getting the same results as the one above.
ANY suggestions PLEASE!!
SELECT
TOP 1 (CASE when d.intCaseID is null then
(SELECT MAX(t.dteTransaction) FROM tblTransaction t
INNER JOIN tblBankAccount b ON b.intAccountID = t.intAccountID
GROUP BY...
I did learn something, but I still can't get my query to work. I think its the multiple joins. The COALESCE could work but its only functioning like my original query.
It will pull a value when d.dtePosted is not null, which is correct, BUT its not pulling a value when d.dtePosted is NULL and...
NEED SOME HELP!! I've created the query below. I need a query that will look in a table and if intCaseID is null, then will pull a date in another table, else will pull a date in that table.
Right now it only works one way if the value is not null, it works correctly. If its null, then it...
You're right the Count statement in the SELECT clause is what caused alot of my problems. I rewrote it to this and it did what I needed.
Thanks for everyones advice:
SELECT
ba.intAccountID, c.vchTrustee, c.vchCaseNumber, ba.vchAccountNumber, c.intStatus
FROM
tblBankAccount ba
INNER JOIN...
I've created the below query but I get an error of :
Server: Msg 245, Level 16, State 1, Line 1
Syntax error converting the varchar value '562-223' to a column of data type int.
Server: Msg 248, Level 16, State 1, Line 1
The conversion of the varchar value '312602821065' overflowed an int...
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.