1

(4 replies, posted in Script)

Any comments?

Hi everyone,

I want to enable searching on my form. However, it seems we can only search one field at a time with an input text.

Is there any way to use just one input field to search multiple fields from a table? For example, I have a field for a name and another one for a last name. Is there any way to search both using just one input, regardless of whether we're searching for a name or a last name? I don't want to use any combinations of both.

Many thanks!

3

(4 replies, posted in Script)

Hi everyone,

I created a bar chart using this script example (This one: https://myvisualdatabase.com/forum/view … ?id=5340), and it works. I have data for months and income. Currently, I'm using numbers instead of month names to represent the correct month. Is there any way to use strings instead of floats or dates in bar charts?

Many thanks!



ChartBar := TChart.Create(Main);
  ChartBar.Parent := Main.LevelChart;
  ChartBar.Align := alClient;
  ChartBar.AddSeries(TBarSeries.Create(ChartBar));


ChartBar.Series[0].AddXY(Month,Value);

derek wrote:

Hi Sonixax,
Perhaps you can take a simpler approach (providing I understand your problem correctly).
Can you not just use two calculated fields (one for 'month' and one for 'year') formatted using 'strftime'?
Have a look at the attachment.
Regards,
Derek

Hi
Thank you for the solution, it solved my Problem.:)

Hi everyone,

I just have a question regarding my query. I want to have a query to filter some results in my grid based on a date time picker data.

This is my current query in a calculated field in the database and it works like a charm:

bookings.monthly_fee * ROUND((JULIANDAY('now') - JULIANDAY(start_date))/30)  - (SELECT ifnull(SUM(amount),0) from payments where payments.id_bookings = bookings.id) 

Now I want to filter based on the year only and month-year instead of the current date. This means when I select the year only, the query should change the current date to the last day of that year. Similarly, when I select a month, it should set the current date to the last day of that month in the selected year.

How can I do it?

Additionally, how can I utilize the DateTimePicker component value in an SQL query form? I mean without any script. Alternatively, if I have to use scripts, how can I pass the results to my grid to display them?

Many thanks and have a lovely day!

6

(1 replies, posted in Reports)

Please help big_smile

7

(1 replies, posted in Reports)

Hi,
I just have a simple project and want to sum a column data in report, but instead of sum it show all records behind each other!

how can I fix it?

many many thanks

8

(1 replies, posted in Reports)

Hi everyone,
I just want to know how can I change Thousand seperator from , to .!
It seems fastreport ignoring system setting.
so what is the correct format setting?

many many thanks smile

Many Many thanks.

Thank you Derek, you made my day

11

(2 replies, posted in Script)

Hi,
I just have a simple DB, All i want to save data to database and set focus to a textbox after hitting enter.
saving works fine, but set focus not working!
how can I make it to work?
I just attached the project.

and I have another problem, Cannot have empty value for relations and must select notnull in database to prevent of error but sometimes I need to leave the field empty sad

Many Many Thanks

Also, this is my calculated field query:

(CASE 
WHEN (SELECT b.id_bestand 
    FROM positionen b 
    WHERE b.id_bestand=bestand.id) != 0 
THEN "Verkauft" ELSE "auf Lager" END)        

hi,
I have a calculated field in my database which is returned sold or available as text.
I have another combo box which shows all records from that table.
I need to know how can I filter every SOLD items to prevent showing them in my combobox?

Many many thanks smile

any Idea?

Hi, I have three printers on my system, each with a different paper size and type.

I want to define a default printer for every report template in my app settings. How can I do that using scripts? I have already created a setting system using ini read and write, and I want to define the printer for each template in that ini file.

Many Thanks

16

(0 replies, posted in Script)

Hi,
is there any example to show how to retrieve currency conversion rate from free online services?

main currency is Euro, and then I need to show the rate in Dollar and Pound.
Many Many thanks

17

(9 replies, posted in Script)

Sparrow, Derek, k245.
Many many thanks for your support smile
Everything now working perfectly, I just have another question which is need another topic.

Many thanks again.

18

(5 replies, posted in General)

vovka3003 wrote:

Забей на HEX, сохраняй и восстанавливай десятичное (оно же и есть TColor)

Form1.Edit1.Text := IntToStr(cDialog.Color);
Form1.Edit1.Color := StrToInt(Form1.Edit1.Text);

Many Thanks but when I run this:

 TdbPanel(Main.FindComponent('Panel'+IntToStr(i))).Color := StrToInt(SQLExecute('SELECT busycolor FROM settings order by id desc'));

I Have this:

FF0000 is not a Valid Integer value

How can I solve this?

19

(9 replies, posted in Script)

derek wrote:

Hi Sonixax,
Works okay for me (Windows10 and MVD 6.5) - see attachment.
Maybe upload your project to see if there is something else going on.
Derek.

Sure,
Attached you can find the project.
Many thanks

20

(5 replies, posted in General)

Many Many Thanks,
Sorry for late I was in Hospital.

One ore question, how can I convert that Hex string to TColor?

Many Many Thnaks

21

(9 replies, posted in Script)

I have a question,
this

Main.TransGrid.Cells[9,i] := 'Nein';

return an error and said Nein is not integer!!!!!!
before update to v6 this one was ok but now its not working anymore sad

How can I fix it?

Many thanks

22

(5 replies, posted in General)

Hi,
Is it possible to have a color picker? and save the value as hex in db?
many many thanks

23

(1 replies, posted in Script)

Hi,
Is there any way to send a input box variable to a report as variable which is not saved in database?

Many thanks

Hi,
Many thanks again for your help.
Just have another question.

this is the query which is works fine

(SELECT JULIANDAY('now') - JULIANDAY(date) AS date_difference_in_days FROM payments where payments.id_customers = customers.id ORDER BY payments.id DESC LIMIT 1)  

I just want to change it a little bit.

If there is no date record in payments records then I want to take start_date field from bookings table instead.

is it possible?!

25

(9 replies, posted in Script)

Wow,
Many Many Thanks