Topic: How to Make Pending Value Like This?
How can I Make Pending the way I want it
Please Check out attached Image
thanks
My Visual Database → General → How to Make Pending Value Like This?
How can I Make Pending the way I want it
Please Check out attached Image
thanks
Any one like to help me here please
Hi Kim,
Thanks for the screenshot - I can see exactly what you're wanting to show and I'm sure it can be done as a calculated field but I've not been able to get the syntax correct.
Pretty sure Dmitry will have a way around it.
Derek.
It's possible, if every records of ingredients have DATETIME field with different values. Example of calculated field
(
(SELECT cereal.grams FROM cereal WHERE cereal.id=subrecords.id_cereal)
-
(SELECT TOTAL(s.gram) FROM subrecords s WHERE (s.id_cereal=subrecords.id_cereal) AND (s.date <= subrecords.date ))
)
Instead of using date I used counter same query thanks (as you mentioned on home page this program is portable so date and time can be anything on different computer) @Dmitry but I couldn't understand what you have done with Query
(SELECT TOTAL(s.gram) FROM subrecords s...
what is "s" can you please explain or just give me technical word for it I will google it again thanks
It's possible, if every records of ingredients have DATETIME field with different values. Example of calculated field
( (SELECT cereal.grams FROM cereal WHERE cereal.id=subrecords.id_cereal) - (SELECT TOTAL(s.gram) FROM subrecords s WHERE (s.id_cereal=subrecords.id_cereal) AND (s.date <= subrecords.date )) )
Hi Kim,
In Dmitry's solution to your 'pending' question, he needs to use a row in 'subrecords' to then read itself - once to calculate the running total and once to filter all the records that are <= to the particular date of the row.
You can't DIRECTLY refer to the same table twice (it would be ambiguous) so you need to redefine it when it's referred to a second time.
So when he writes '.....from subrecords s........', he is redefining the second use of 'subrecords' as 's' and then subsequently uses 's.id_cereal=subrecords.id_cereal.id' etc etc. He could just as easily have redefined it as 'subrecords2' but 's' is easier!
.
As a side issue, I often redefine tables when writing a query or script - not because I'm referring to the same table more than once, but simply to save typing (such bad habits)! Have a look at the code below:
.
select
a.record_count,
a.salutation,
a.name,
strftime('%d-%m-%y', a.joined),
b.type,
a.phone,
a.email,
a.id
from members a, model b
.
which does exactly the same as -
.
select
members.record_count,
members.salutation,
members.name,
strftime('%d-%m-%y', members.joined),
model.type,
members.phone,
members.email,
members.id
from members, model
.
Hope all of that makes sense.
Regards,
Derek.
kim143
Check it out
http://www.w3resource.com/sql/subquerie … liases.php
Hello Community
@Dmitry calculated field only works when I enter the integer value like 100,200 or 10 but when I add float value like 10.2, 1.25 it does not count correctly the pending value
Please check gchild.png image in zip file
Anyone like to help please do so.
My Visual Database → General → How to Make Pending Value Like This?
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi