| Author |
RE: Filling database table field from ListBoxes |
frangonve
Member
Posts: 110
Location: Madrid (Spain) until I can live at the beach
Joined: 18.06.08 |
| Posted on 17-01-2010 11:41 |
|
|
Hi, now I want to modify the text in label28:
EasyDataSet1
Table Settings
First and only Record
Field Period= 0 => Label28 displays "Trades Yesterday"
EasyDataSet1
Table Settings
First and only Record
Field Period = X (not 0) => Label28 displays "Trades in the last X hours"
Being label28 updated whenever the content of Field Period is changed.
Please. Can you give me a hint?
Cheers
Francisco
Edited by frangonve on 17-01-2010 11:43 |
|
| Author |
RE: Filling database table field from ListBoxes |
yw
Administrator
Posts: 670
Location: ***
Joined: 23.06.05 |
| Posted on 17-01-2010 15:02 |
|
|
Here we need a little help with SQL coding . For the SQL property of EasyDataSet1, add a new calculated field by checking "Show SQL" checkbox and typing needed SQL code, for example:
select {your original field list} , IIF(Period=0, 'Trades Yesterday', 'Trades in the last ' + CStr(Period) + ' hours' ) as TradesPeriod FROM {your original FROM clause}
That is, insert the following SQL code into the original SQL code the Query Builder generates:
, IIF(Period=0, 'Trades Yesterday', 'Trades in the last ' + CStr(Period) + ' hours' ) as TradesPeriod
Now you have a new field named TradesPeriod in EasydataSet1, you can bind the label to this field.
I tried it and it works. But please note the following issues:
1. I am using MS Access database. If you are using other databases then IIF and CStr may not be available and other commands should be used. For example, CASE, CAST, Convert, etc. Let me know what database you are using and I'll find out the correct commands.
2. Current Query Builder has a problem of converting all text into upper case. So, "Trades Yesterday" becomes "TRADES YESTERDAY". We are fixing it.
Edited by yw on 17-01-2010 15:03 |
|
| Author |
RE: Filling database table field from ListBoxes |
frangonve
Member
Posts: 110
Location: Madrid (Spain) until I can live at the beach
Joined: 18.06.08 |
| Posted on 18-01-2010 17:48 |
|
|
Thanks for your help!!
I tried your solution.
But the label binded to the calculated field TradesPeriod is not updated when a new value is input in the Period field and the EasyDataset.Update action is completed (the label binded to Period field is updated instantly).
Cheers
Francisco |
|
| Author |
RE: Filling database table field from ListBoxes |
yw
Administrator
Posts: 670
Location: ***
Joined: 23.06.05 |
| Posted on 18-01-2010 22:58 |
|
|
|
Yes, the calculated fields are not being refreshed. We will fix it... |
|
| Author |
RE: Filling database table field from ListBoxes |
yw
Administrator
Posts: 670
Location: ***
Joined: 23.06.05 |
| Posted on 23-01-2010 19:54 |
|
|
Please download a new version from http://www.limnor.com/Studio/LimnorStudioSetup.msi.
Please modify your application to execute an EasyDataset.FetchData action after calling EasyDataSet.Update action, to let the database engine to recalculate the calculated fields.
|
|
| Author |
RE: Filling database table field from ListBoxes |
frangonve
Member
Posts: 110
Location: Madrid (Spain) until I can live at the beach
Joined: 18.06.08 |
| Posted on 24-01-2010 16:43 |
|
|
Thanks, I'll do.
Cheers
Francisco |
|
| Author |
RE: Filling database table field from ListBoxes |
frangonve
Member
Posts: 110
Location: Madrid (Spain) until I can live at the beach
Joined: 18.06.08 |
| Posted on 31-01-2010 11:09 |
|
|
Hi,
I downloaded the last beta and now when the EasyDataset1.Update action is assigned to a button, the calculated fields are instantly refreshed.
EasyDataset1.Query and EasyDataset1.Fetch actions are now not only redundant but they are stopping the update of the database.
Thanks
Francisco |
|
| Author |
RE: Filling database table field from ListBoxes |
yw
Administrator
Posts: 670
Location: ***
Joined: 23.06.05 |
| Posted on 07-02-2010 02:36 |
|
|
The database support is improved. Please download a new version from http://www.limnor.com/Studio/LimnorStudioSetup.msi. All database samples have been updated. Existing projects need to be adjusted by re-creating data-bindings.
Query and Fetch will not stop update of the database. |
|
| Author |
RE: One step more and more doubts |
frangonve
Member
Posts: 110
Location: Madrid (Spain) until I can live at the beach
Joined: 18.06.08 |
| Posted on 07-02-2010 05:44 |
|
|
This post was sent to another thread by mistake...
One step more and more doubts
Now the different labels have to show the correct values and being updated when new fields are added to the trades table and when the settings table is updated and when the system time changes.
Example:
Label17 shows the total number of trades in selected period:
if period=0 -> number of trades today
if period=X -> number of trades in the last X hours
number of trades is the number of records filtered by the >=@Date Where clause (which easyGrid or EasyDataSet property holds the number of records filtered by the Where Clause?)
Label17.SetText action has to be linked to the RowCount of an EasyGrid??? with Where Clause @Date.
@Date = <Today> 00:00 if period=0
@Date = Now.AddHours (-{Form1.DataSet1.Fields.Period}) if period not 0
How can the text in Label17 (and the rest of labels)be refreshed as the system time changes (once per minute)?
Cheers
Francisco |
|
| Author |
RE: Filling database table field from ListBoxes |
frangonve
Member
Posts: 110
Location: Madrid (Spain) until I can live at the beach
Joined: 18.06.08 |
| Posted on 07-02-2010 08:53 |
|
|
I think I found the answer to my last question (updating regularly the labels):
I think the Timer element is the answer. Right?
Cheers
Francisco
Edited by frangonve on 06-03-2010 17:52 |
|
| Author |
RE: Filling database table field from ListBoxes |
yw
Administrator
Posts: 670
Location: ***
Joined: 23.06.05 |
| Posted on 07-02-2010 14:09 |
|
|
|
In your situation a Timer can be a solution. |
|
| Author |
RE: while loop |
vince
Member
Posts: 100
Location:
Joined: 30.01.07 |
| Posted on 22-02-2010 12:43 |
|
|
Hello
i also had difficulty understanding how you would arrive at a FALSE condition to end your while loop...
How would you simply set it's condition to FALSE by using somekind of action in a list.....(the list that that LOOP was actually executing)
a WHILE LOOP is just a repeating IF THEN statement.
There was also a bug in the LOOP WHILE performer which dge may have fixed. You were only able to give the LOOP some actions from it's main properties window....(not from the WHILE DO window)
Vince. |
|