A
|
ann 6/23/2010 |
Hi, $sql="select max(substr(PURCHASE_NUMBER,9)) as mx from TableName where substr(PURCHASE_NUMBER,5,2)=month(now())";
|
![]() |
romaldus author 6/23/2010 |
Hi, use Before record added event on the Events tab to calculate PURCHASE_NUMBER. Here is a sample: $sql="select max(substr(PURCHASE_NUMBER,9)) as mx from TableName where substr(PURCHASE_NUMBER,5,2)=month(now())";
|
![]() |
romaldus author 6/23/2010 |
I have another question based on the code above. How to modify the code above so that each transaction number started with "TN" |
A
|
ann 6/24/2010 |
Hi, $str="TN"; |
![]() |
romaldus author 6/24/2010 |
Hi, just concat "TN" to the variable $str. here is a sample: $str="TN";
$sql="select max(substr(PURCHASE_NUMBER,9)) as mx from TableName where substr(PURCHASE_NUMBER,5,2)=month(now())";
|
A
|
ann 6/25/2010 |
Hi, $sql="select max(substr(PURCHASE_NUMBER,11)) as mx from TableName where substr(PURCHASE_NUMBER,7,2)=month(now())";
|
![]() |
romaldus author 6/25/2010 |
Thanks ann but the number only increment until 10 and stuck... $sql="select max(substr(PURCHASE_NUMBER,11)) as mx from TableName where substr(PURCHASE_NUMBER,7,2)=month(now())";
|
![]() |
romaldus author 6/25/2010 |
Hi, use Before record added event on the Events tab to calculate PURCHASE_NUMBER. Here is a sample: $sql="select max(substr(PURCHASE_NUMBER,9)) as mx from TableName where substr(PURCHASE_NUMBER,5,2)=month(now())";
|
B
|
bangke 6/25/2010 |
[size="3"]This one is also stop the increment in number 10[/size] |
B
|
bangke 6/27/2010 |
[size="3"]This one is also stop the increment in number 10[/size]
$sql="select max(substr(PURCHASE_NUMBER,9))...........
|
B
|
bangke 6/27/2010 |
The problem might happen in this line of code: $sql="select max(substr(PURCHASE_NUMBER,9))...........
|
J
|
Jane 6/28/2010 |
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error. |
![]() |
romaldus author 6/28/2010 |
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.
$sql="select max(substr(PURCHASE_NUMBER,9)) as mx from TABLENAME where substr(PURCHASE_NUMBER,7,2)=month(now()) order by mx";
|