George,
I have been analyzing your explanation and it is great. I went through and added the "clcharity." to the query to keep it straight in my mind so that eliminated the confusion. However, I am getting this error:
Server: Msg 241, Level 16, State 1, Line 2
Syntax error converting...
I have problem. Below is a set of data I am working with and I only need the record with the newest date. I used this script with MAX(assessdate1) but I am still getting 2 or more dates. I thought if MAX is used then you would only get the most recent date. Thanks ahead of time for for...
Here is my code I am working on:
Here is some background...I am looking at finding scheduled clients who have appointments in the future with a code of 'reentrmr30'. Of these people who have an appointment for a 'reentrmr30', how many do not have a flag of 'b' AND have not had a 'ev60' in the...
Borislav,
This seems to work well and returns the MAX reported date but there are times when this reported date field is empty or null. In that scenario I also need that record. I tried to add a CASE statement: (but that did not work) Any help is greatly appreciated...now I am off to lunch...
Yes, the question is...where do I put this code?
SELECT MyTable.*
FROM MyTable
INNER JOIN (SELECT a.account,
MAX(c.rundate) AS Test
FROM clchrge
GROUP BY a.account) Tbl1
ON a.account = a.account AND
c.rundate = Tbl1.DateField
Here is my code! I have to admit that I am having trouble inserting Borislav's code because of the multiple joins alerady in the script. I have been looking at this for 35 minutes and am becoming bug eyed.
Brad
SELECT DISTINCT a.ACCOUNT, b.PLNAME, b.PFNAME, d .PROV, d .NAME2, c.status_id...
I wrote some code that gives me these results but I only want the top 1 record for 177979. Not sure how to do this.
Many thanks ahead of time.
Brad
600630 DRYER DON 8/04/2007
177979 FOUNCH DONNA 8/10/2007
177979 FOUNCH DONNA 8/12/2007
177979 FOUNCH DONNA 8/14/2007
614283 GERDNER KEM 8/15/2007
I am trying to use the Web Assistant Wizard to run the script below and it is failing. it doesn't seem to like the (parentheses) or [brackets] or datediff. so I am not sure what to do. Any insight working with Web Assistant Wizard would be appreciated.
wfd1bdb
SELECT SSNO as AccountNo...
I am getting dates out of the db in this format: How do I get rid of the 08:22:00.000 from the date. I am using this cast statement: cast(reported as datetime)
2007-05-14 08:22:00.000
Thanks in advance for advice, Brad
Does CHARINDEX('Yearly RR Required', clmastbcassr.RECOMMEND)
mean find the character string 'Yearly RR Required' within the field clmastbcassr.RECOMMEND? If so how can I get it to find 'Yearly RR Required' and 'YYR Req' and 'Yearly RR Req'? Because users have typed in different string to mean...
I have a relatively simple query except 1 field is a text field which users can either choose from a pull down or type the entry. The problem occurs when the users abbreviate what are supposed to be standardized answers because if they don't they will not fit into the field. For example: 'Yearly...
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.