![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I have a query statement like select max(cust_id) from customer I want to store the result into a variable. How can I achieve this ? But if I use like "select max(cust_id) from customer into array maxValue", When customer database is blank, the result will be zero, but it is not storing zero into maxValue, If I have atleast one record in the database, it stores the result into maxValue. I have coded in the cmdAdd.Click and when the customer database has zero record IF THIS.caption = \<Add" maxValue = 0 select max(cust_id) from customer into array maxValue maxValue = maxValue + 1 ENDIF thisform.cust_id1.text1.value=maxValue dodefault() It is throwing an error saying that maxValue is not an array. But this code works fine if I have atleast one record. |
|
Basically I want to achive this... I have form created using form wizard, when I run the form the cust_id should get incremented automatically when I click "Add" button. Thanks in Advance. Ashok |
#3
| |||
| |||
|
|
Hi, I have a query statement like select max(cust_id) from customer I want to store the result into a variable. How can I achieve this ? But if I use like "select max(cust_id) from customer into array maxValue", When customer database is blank, the result will be zero, but it is not storing zero into maxValue, If I have atleast one record in the database, it stores the result into maxValue. I have coded in the cmdAdd.Click and when the customer database has zero record IF THIS.caption = \<Add" maxValue = 0 select max(cust_id) from customer into array maxValue maxValue = maxValue + 1 ENDIF thisform.cust_id1.text1.value=maxValue dodefault() It is throwing an error saying that maxValue is not an array. But this code works fine if I have atleast one record. Basically I want to achive this... I have form created using form wizard, when I run the form the cust_id should get incremented automatically when I click "Add" button. Thanks in Advance. Ashok |
#4
| |||
| |||
|
|
Ashok wrote: Hi, I have a query statement like select max(cust_id) from customer I want to store the result into a variable. How can I achieve this ? But if I use like "select max(cust_id) from customer into array maxValue", When customer database is blank, the result will be zero, but it is not storing zero into maxValue, If I have atleast one record in the database, it stores the result into maxValue. I have coded in the cmdAdd.Click and when the customer database has zero record IF THIS.caption = \<Add" maxValue = 0 select max(cust_id) from customer into array maxValue maxValue = maxValue + 1 ENDIF thisform.cust_id1.text1.value=maxValue dodefault() It is throwing an error saying that maxValue is not an array. But this code works fine if I have atleast one record. Really? It looks like a type mismatch to me. DIMENSION maxValue(1) maxValue(1)=0 etc ought to work Basically I want to achive this... I have form created using form wizard, when I run the form the cust_id should get incremented automatically when I click "Add" button. Thanks in Advance. Ashok |
#5
| |||
| |||
|
|
You can also evaluate _tally after the Select Max() ... statement. hth -Stefan "Ashok" <asjayara (AT) cisco (DOT) com> schrieb im Newsbeitrag news:408763CE.7050209 (AT) cisco (DOT) com... Hi, I have a query statement like select max(cust_id) from customer I want to store the result into a variable. How can I achieve this ? But if I use like "select max(cust_id) from customer into array maxValue", When customer database is blank, the result will be zero, but it is not storing zero into maxValue, If I have atleast one record in the database, it stores the result into maxValue. I have coded in the cmdAdd.Click and when the customer database has zero record IF THIS.caption = \<Add" maxValue = 0 select max(cust_id) from customer into array maxValue maxValue = maxValue + 1 ENDIF thisform.cust_id1.text1.value=maxValue dodefault() It is throwing an error saying that maxValue is not an array. But this code works fine if I have atleast one record. Basically I want to achive this... I have form created using form wizard, when I run the form the cust_id should get incremented automatically when I click "Add" button. Thanks in Advance. Ashok |
#6
| |||
| |||
|
|
Hi Stefan, Thanks .. Can you give me an example, how to use this .. -Ashok Stefan Wuebbe wrote: You can also evaluate _tally after the Select Max() ... statement. hth -Stefan "Ashok" <asjayara (AT) cisco (DOT) com> schrieb im Newsbeitrag news:408763CE.7050209 (AT) cisco (DOT) com... Hi, I have a query statement like select max(cust_id) from customer I want to store the result into a variable. How can I achieve this ? But if I use like "select max(cust_id) from customer into array maxValue", When customer database is blank, the result will be zero, but it is not storing zero into maxValue, If I have atleast one record in the database, it stores the result into maxValue. I have coded in the cmdAdd.Click and when the customer database has zero record IF THIS.caption = \<Add" maxValue = 0 select max(cust_id) from customer into array maxValue maxValue = maxValue + 1 ENDIF thisform.cust_id1.text1.value=maxValue dodefault() It is throwing an error saying that maxValue is not an array. But this code works fine if I have atleast one record. Basically I want to achive this... I have form created using form wizard, when I run the form the cust_id should get incremented automatically when I click "Add" button. Thanks in Advance. Ashok |
![]() |
| Thread Tools | |
| Display Modes | |
| |