Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Number at mytext
Message
De
21/02/2005 12:54:05
 
 
À
21/02/2005 12:36:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00966918
Message ID:
00988902
Vues:
70
hi,
just i need to know is that possible or not,
if i must use 2 field,Mr. tore send the soluation ,it works no problem.
with thanks so much for Mr.tore,
thanks.

>Mohammed,
>
>I've noticed that you have many people here writing your programs for you. You are a lucky man!
>
>I just want to say that what the customer wants and what data you store in tables are 2 DIFFERENT THINGS.
>
>If the customer wants "2005-0001" then it is a display issue.
>To "solve" that problem you need a minimum of 2 fields - a date field from which you can extract the year and a "number" field which you maintain internally (in your table data, that the customer never sees). You also need to keep a "next number" field somewhere.
>
>To display that to the customer according to his wishes you will take the two fields and combine them for displaying.
>
>good luck, and try reading the documentation sometime. You may be able to actually LEARN how to program in VFP that way rather than having people here write your programs for you.
>
>
>>hi,
>>thanks,
>>the customer want one field for billno and date as 2005-0001,
>>no field(date) at myform any more, is that possible or not,
>>thanks.
>>>I have already given you a good sugegstion on how to do this the right way, but I will repeat.
>>>
>>>The important thing to understand is that what you keep in the table, and what you print on the invoice, is different! Don't hang up in how you show the invoice, because that is only a question of how you want it to look.
>>>
>>>In the billinfo file, you already have a field for the date. I suggest that the billno field is an integer field which you start from 1 each new year. Then, on the invoice and on the screen, you have a function which transforms this info into how you want it to look.
>>>
>>>If you want 2005-1, you use this function: lcPrintable=Str(Year(billdate()),4) + '-' + LTRIM(str(billno))
>>>If you want 2005-0001 (which I and most people prefer) you use lcPrintable=Str(Year(billdate()),4) + '-' + Substr(Str(1000000+billno,7),4)
>>>If you want 2005-00001 (allows 99999 invoices per year) you use lcPrintable=Str(Year(billdate()),4) + '-' + Substr(Str(1000000+billno,7),3)
>>>If you want 2005-000001 (allows 999999 invoices per year) you use lcPrintable=Str(Year(billdate()),4) + '-' + Substr(Str(1000000+billno,7),2)
>>>
>>>But in the tabel billno is 1 in all these cases.
>>>
>>>>hi,
>>>>thanks,
>>>>but many months ago i ask when i have to fields,one for billno another for date,
>>>>my qustion for one field only, have billno as 1 and year(date) as 2005,
>>>>to be somthing as 2005-1.
>>>>all code under this is what you send to me months ago, with thanks so much.
>>>>
>>>>thanks.
>>>>
>>>>
>>>>
>>>>>Unless I misunderstand you completely, you now ask exactly the same question as you asked many months ago?
>>>>>
>>>>>>hi,
>>>>>>thank you for reply,
>>>>>>this code under for query it works,
>>>>>>but first how i can insert mybillno as 2005-1, to one field (billno),
>>>>>>and increment 1, evry new bill autamatic.as 2005-2....
>>>>>>
>>>>>>
>>>>>>lcBillno=thisform.txtBillno.value
>>>>>>Select * from billinfo where billno=lcBillno into cursor curBill
>>>>>>
>>>>>>thanks.
>>>>>>
>>>>>>
>>>>>>
>>>>>>>This code will select the data into a cursor curBill.
>>>>>>>lcBillno=yourpage.txtBillno.value
>>>>>>>Select * from billinfo where billno=lcBillno into cursor curBill
>>>>>>>
>>>>>>>>hi,
>>>>>>>>i need your help,if you have a time, to insert this code under at one field (billno ),and if i want to make query to any bill
>>>>>>>>becuse my customer need to make query about his bills via billno only
>>>>>>>>as 2005-1
>>>>>>>>i think myfield must be character,
>>>>>>>>
>>>>>>>>lnYear=YEAR(DATE())
>>>>>>>>SELECT MAX(billno) from billinfo WHERE YEAR(billinfo.billdate)=lnYear INTO ARRAY laAarray
>>>>>>>>if _tally=0
>>>>>>>>  laArray=1
>>>>>>>>  thisform.text1.value=RIGHT(STR(YEAR(DATE()),4),2) + '_'+RIGHT(STR(10000+(billinfo.billno+1),5),4) else
>>>>>>>>  thisform.text1.value=(RIGHT(STR(YEAR(billinfo.billdate),4),2) + '_'+RIGHT(STR(10000+billinfo.billno+1,5),4))
>>>>>>>>endif
>>>>>>>>INSERT  INTO  billinfo(billno,billdate) VALUES (val(right(thisform.text1.Value,4)),DATE())
>>>>>>>>
>>>>>>>>thanks.
>>>>>>>>
>>>>>>>----- SNIP -----
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform