Try convert instead of cast:
select * from
(SELECT P.PolicyId
, P.EffectiveDate
--Check of 'Original Policy Start Date' to identify if Outpatient paragraph should be applied or not
,CASE
WHEN CONVERT(CHAR(8), CONVERT(Date, pa.PolicyAttributeValue, 112) <...
In the end I created two calculated fields in the underlying table using Iif statements. I then created two textboxes in the report group footer for budget code and used these to sum and display the totals.
Hi,
I am stuck on an MS Access 2010 report. I have the report grouped by a budget code. There is a column for total number of jobs and a column for the job type. I want to sub total the total number of jobs based on job type. So for example if the job type is skilled then create a sub total...
Here are a few I found helpful recently:
http://code.tutsplus.com/tutorials/why-you-should-be-using-phps-pdo-for-database-access--net-12059
http://wiki.hashphp.org/PDO_Tutorial_for_MySQL_Developers
I started to use PDO initially as I was fed up with messy looking SQL strings, but soon found...
Hi, I have solved the problem. I forgot to check the server request method. I enclosed everything in:
if ($_SERVER["REQUEST_METHOD"]=="GET")
{
}
and it works fine now. Funny how the other queries worked without it though!!!!
Hi,
I have a weird problem. I am using PDO prepared statements against an MySQL database. When I use named parameters the results return fine, however I have one condition that if the string "all" is passed in as the GET value then the prepared statement should select all from the table. This...
I can understand what is happening now, thanks for the insight. It is frustrating that SQL Server can get the same job done with simpler syntax i.e this works for me and the CAST function gives me the result without rounding down:
SELECT CAST(COUNT(OrderItems) AS FLOAT) / COUNT(DISTINCT...
I cannot get that to work. I have sample data such as follows:
OrderItem OrderID
1 2
5 5
5 1
8 3
6 3
12 4
so I am trying to calculate 6 order items / 5...
Hi, the table structure is:
OrderItem integer
OrderNumber integer
In this table there is no quantity field. This is Access SQL. In this example I am just trying to return a single number that represents the average number of order items per order. Cheers. I know this is a contrived example, but...
Hi, I have a table that lists Order Numbers and Order Items for each order number. I am trying to work out the average number of items per order, but am stuck in aggregate function errors. So for example there are 11 order items in total, and there are 4 different order numbers (with some listed...
I see now, you changed the reference with emp2 pointing to the emp object. So any changes made to either emp or emp2 would update the same object. I think !!!!
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.