26

(38 replies, posted in Russian)

Спасибо Дмитрий. Очень помогло.
Еще один нюанс в этом же разделе.
Приведу пример. На гриде имеется:

I № I   Кат руз дехоти I
  1               560
  2               350

Надо чтобы было:

I № I   Кат руз I
I      I  дехоти   I
  1         560
  2         350

Т.е. я хочу в место длинного заголовка колонки перенести часть него вниз. Надеюсь смог объяснить.

27

(5 replies, posted in General)

Thank you Sergen. Its very useful for me. By the way are you from Turkey?

28

(5 replies, posted in General)

Dear Sergen and Mathmathou!
Could you attach an example of your work using help method?

29

(38 replies, posted in Russian)

Уважаемый Дмитрий!

С начало пример:
WITH RECURSIVE dates(dateValue) AS (
  VALUES({DateTimePicker1})
  UNION ALL
  SELECT date(dateValue, '+1 day')
  FROM dates
  WHERE dateValue < {DateTimePicker2}
)

SELECT

"dateValue" as Сана,
( Select SUM(kat) from profile where
       (CASE WHEN {ComboBox1} =-1 then
        (CASE WHEN {ComboBox2} =-1 then 1=1 end) else
        (CASE WHEN {ComboBox2} =-1 then profile.id Between
         (Select Min(id) from profile where profile.id_department = {ComboBox1}) and
         (Select Max(id) from profile where profile.id_department = {ComboBox1})
        else profile.id= {Combobox2} end) end)
) as Катхо

FROM dates

В гриде в первом столбце Сана, во втором Катхо. Если например в скрипте писать вместо "as Катхо" - "as Кат Руз" то выдает ошибку. Т.е. после as должно быть одно слово, а надо чтобы было две или три. Как быть? Помогите пожалуйста.

30

(1 replies, posted in Russian)

что вы имеете ввиду - вычислить пустые таблицы?

31

(1 replies, posted in Russian)

попробуйте так

procedure caForm_CheckBox1_OnClick (Sender: string);
begin
  if caForm.Checkbox1.Checked = True then
  begin
        caForm.DateTimePicker2.Enabled := False;
  end  else
  begin
        caForm.DateTimePicker2.Enabled := True;
  end;
end;

attach your project

приложите проект и какая у вас версия MVD?

34

(8 replies, posted in General)

Your have misunderstood me, when I said OnClick, I meant - procedure Form1_WORCESTER_OnClick (Sender: string);
Your procedure is not right, change it and you will see the result.

35

(8 replies, posted in General)

you can change the size of form1 on click, try it yourself, if not then i will help you. also attach your real project and describe what you want, it wuould be easier to help you.

36

(8 replies, posted in General)

See the attached file. I also added another feature, I think you will like it.

37

(38 replies, posted in Russian)

можете дать пример?

38

(11 replies, posted in General)

v_pozidis wrote:

ok here is my example. from the first screen press the first button and from there you will go to another screen. try to press the bib button .When pressin. it it should show a message that if the record you have choose with that lastname it is used in another table. Try the lastname Billy.

Check it!

39

(11 replies, posted in General)

attach your project

40

(1 replies, posted in General)

attach your project and describe step by step what is wrong

41

(11 replies, posted in General)

v_pozidis wrote:

I have test it it works,
but how can I just have a messagebox that it will say a message that this record is related in another table. What I want to do is in the following example : I have 2 tables (Stoixeia and Ypothesi  with relationship)  if  the  Stoixeia.id  e includes in the other table Ypothesi (Ypothesi.id_Stoixeia)  it sould give me a message
I try using the followin script but nothing. (I know that my SQL knowledge is very bad)


if  SQLExecute('Select id from Stoixeia Where id =  Ypothesi_id.Stoixeia') then
begin
showmessage('aaaaaaaaaaaa');
end;

Please your help.


if  SQLExecute('Select Count(id) from Stoixeia Where Stoixeia.id = Ypothesi.id_Stoixeia') > 0 then
begin
showmessage('aaaaaaaaaaaa');
end;

42

(38 replies, posted in Russian)

спс, но это я знаю, думал есть еще какой нибудь другой способ.
Еще один вопрос. Этот скрипт перечисляет все даты от DateTimePicker1 до DateTimePicker2.

WITH RECURSIVE dates(dateValue) AS (
VALUES({DateTimePicker1})
UNION ALL
SELECT date(dateValue, '+1 day')
FROM dates
WHERE dateValue < {DateTimePicker2}
)

Например я выбрал дату 01.01.2017 по 31.12.2017
Результат:
2017-01-01
2017-01-02
2017-01-03
2017-01-04
...
31.12.2017

Как переписать запрос чтобы результат выглядил вот так:

2017-01-01
2017-01-02
2017-01-03
2017-01-04
...
2017-01-31
Январь
2017-02-01
2017-02-02
2017-02-03
2017-02-04
...
2017-02-28
Февраль
2 мес //(тут будут отображаться данные за январь и февраль)
2017-03-01
2017-03-02
2017-03-03
2017-03-04
...
2017-03-31
Март
3 мес //(тут будут отображаться данные за январь, февраль и март)
...
31.12.2017
Декабрь
12 мес // (тут будут отображаться данные за год)

Помогите с реализацией. Спасибо заранее.

43

(38 replies, posted in Russian)

Можете дать пример экспорта данных грида в экзель посредством SQL-запроса?

44

(1 replies, posted in General)

Dear all!
How to export the footer of Tablegrid and its contents to excel?
Any help appreciated. Thanks!

45

(3 replies, posted in Script)

can you attach the solved project?

46

(2 replies, posted in General)

try this:
TotalNetProfit:= frmValidation.edValidTotalNetProfit.Value;
instead of:
TotalNetProfit:= frmValidation.edValidTotalNetProfit;

47

(38 replies, posted in Russian)

Уважаемый Дмитрий!
Возник еще один вопрос по поводу вывода данных TableGrid1 в Excel.
На форме имеется TableGrid1 с данными и с подвалом. Также имеется кнопка, которая выводит данные TableGrid1 в Excel, но данные подвала грида туда не попадают. Как вывести данные подвала вместе с данными грида в экзель? Помоему это тоже надо посредством SQL запроса но не знаю как. Дайте ссылку или пример использования пожалуйста.

48

(38 replies, posted in Russian)

Вопрос решен

49

(38 replies, posted in Russian)

Второй вопрос.
В вашем SQL-запросе в чем разница между:

( Select Count(numberTB) from Base where incomeDate < {DateTimePicker1}

и

( Select Count(numberTB) from Base where date(incomeDate) < date(dateValue)

50

(15 replies, posted in General)

Dear rjkantor,

According to you attached project how will the program identify that 365 days have past?