https://youtu.be/BelvmFOk-yU
Bom Dia/Boa Tarde/Boa Noite
Esse Ao Vivo vai estrear as 14:00 do dia 26/08/2020
DICAS 3022 - WINDEV TUTORIAL 45 - Pesquisa Multicriterio - Uso Parametro - Parte C
Tutoriel WINDEV : Leçon 4.4.c. Recherche multicritère - Utilisation de paramètres
ASSUNTOS
Explicando o que sera feito
Fazendo a condicao de status do pedido
fazendo a condicao de forma de pagamento
como ocultar forma de pagamento
fazendo intervalo de data
SELECT
FROM
WHERE
ORDER
MOSTRANDO COMO EXECUTA A QUERY PARA TESTAR
Video original da Franca
https://youtu.be/iZRuTfLOKVc
Playlist Windev TUTORIAL
SELECT
Orders_pedido.OrdersID AS OrdersID,
Orders_pedido.Date AS DATE,
Orders_pedido.Status AS Status,
Orders_pedido.TotalBT AS TotalBT,
Customer_cliente.FullName AS FullName,
PaymentMode_tipo_pagamento.Caption AS Caption
FROM
Customer_cliente,
Orders_pedido,
PaymentMode_tipo_pagamento
WHERE
PaymentMode_tipo_pagamento.PaymentModeID = Orders_pedido.PaymentModeID
AND Customer_cliente.CustomerID = Orders_pedido.CustomerID
AND
(
Orders_pedido.Status = {ParamStatus}
AND PaymentMode_tipo_pagamento.PaymentModeID = {ParamPaymentModeID}
AND Orders_pedido.Date BETWEEN {ParamData_Inicial} AND {ParamData_Final}
)
ORDER BY
DATE ASC
Using parameters in the query
In our example, the user will be able to select a value for the following search criteria:
- Order status.
- Order payment method.
- Order date.
- To define the query parameters, open the query description window: double-click the background of graphic query representation (or select "Query description" from the popup menu).
- To manage the "order status" parameter:
- Select the Orders.Status item (in the middle of the screen).
- Expand "Selection condition" and select "New condition".
- In the window that is displayed, we are going to specify that the selection condition corresponds to a parameter:
- Select "Is equal to".
- Select "the parameter".
- The name of the parameter is automatically proposed: "ParamStatus".
Remark
We advise you to keep "Param" as the prefix of the query parameters. This allows you to easily find them in the code editor. To find a query parameter, simply type 'Param' and the completion feature of the code editor will propose all the parameters.
- Validate the condition description window. The number "1" appears on the right of "Orders.Status" item, indicating that a selection condition was defined.
- We are now going to define a condition on the payment method. This item is not found in the query result but a condition will be applied to it. To do so, the item will be included in the query result and it will be made invisible so that it is not visible in the result.
- On the left part of the query description window, in the "Orders" data file, double-click on the item "PaymentMethodID". The "PaymentModeID" item appears in the list of query elements.
- To avoid displaying this item in the result:
- Click the icon found on the right of item.
- In the menu that is displayed, select "Don't display".
- To define a selection condition on the "Orders.PaymentModeID" item:
- Select the "Orders.PaymentModeID" item (in the middle of the screen).
- Expand "Selection condition" and select "New condition".
- In the window that is displayed, specify that the selection condition corresponds to a parameter:
- Select "Is equal to".
- Select "the parameter".
- Specify the parameter name: "ParamPaymentModeID".
- Validate the definition of selection condition.
- The last selection condition to define affects the order date. This date must be included between two dates typed by the user.
- In the list of query elements, select the "Orders.Date" item.
- Click the "Between two dates ..." button. This button allows you to define a selection condition.
- In the window that is displayed:
- The selection condition is "Is included between".
- Click "the parameter".
- Specify the parameter name: "ParamStartOfPeriod".
- Click the second "the parameter".
- Specify the parameter name: "ParamEndOfPeriod".
- Validate the definition of selection condition.
- Validate the query description window. The query graph is modified to take into account the selection conditions that have been defined.
- Save the query by clicking among the quick access buttons.
Test of query with parameters
- To run the test of query with parameters:
- Click .
- A window is displayed, allowing you to type the different query parameters.
- Type the following data:
- Uncheck the ParamStatus parameter.
- Select the ParamPaymentModeID parameter. In the lower section of the screen, type "1".
- Select the ParamStartOfPeriod parameter. In the lower section of the screen, type "01/01/2016".
- Select the ParamEndOfPeriod parameter. In the lower section of the screen, type "03/31/2016".
- Validate the window. The query result corresponding to the specified parameters is displayed.
- Close the window.
DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C
Nenhum comentário:
Postar um comentário