Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Christian Tabligan
  Where is Christian Tabligan?
 Bacolod City, Neg. Occ.
 Philippines
 Christian Tabligan
 To: JK M
  Where is JK M?
 Meycauayan City
 Philippines
 JK M
 Tags
Subject: RE: help on date and auto numbering..
Thread ID: 268549 Message ID: 268870 # Views: 26 # Ratings: 0
Version: Visual FoxPro 6 Category: VFP and .NET
Date: Thursday, July 15, 2010 6:20:28 AM         
   


> >
> > Are you newbie?
> >
> > Anyway, analyze 1st the problem. Collect the data you need and make a logic to come up with the output.
> >
> > Data needed:
> >
> >
> > SET DECIMAL TO 0
> > cField = "10-21" && e.x. Data Field
> > nYear = LEFT(cField, 2) && Year from data field
> > nBase = RIGHT(cField, 2) && base number from data field
> > nCurYear = RIGHT(STR(YEAR(DATE())), 2) && current year
> > ?VAL(nYear)
> > ?VAL(nBase)
> > ?VAL(nCurYear)
> > 

> >
> > Business logic:
> >
> >
> > IF VAL(nYear) == VAL(nCurYear)
> >    nId = VAL(nBase) 
> > ELSE
> >    nId = 0
> > ENDIF
> > ?nId + 1
> > 

> >
> > Output:
> >
> >
> > ?nCurYear + "-" + PADL(nId, 2, "0")
> > 

> >
> > Hope this help.
> >
> > Best Regards,
> >
> > CriZ (,")
> >
> > "Happiness is real when shared."
>
> Yes, I'm just new in programming, thanks for this one I'm going to study this :)

Student?? :-O

Best Regards,

CriZ (,")

"Happiness is real when shared."

ENTIRE THREAD

help on date and auto numbering.. Posted by JK M @ 7/13/2010 8:25:45 AM
RE: help on date and auto numbering.. Posted by Bhushan Sahni @ 7/13/2010 8:33:38 AM
RE: help on date and auto numbering.. Posted by JK M @ 7/13/2010 11:48:02 AM
RE: help on date and auto numbering.. Posted by Samir H. @ 7/13/2010 2:52:50 PM
RE: help on date and auto numbering.. Posted by JK M @ 7/13/2010 3:01:08 PM
RE: help on date and auto numbering.. Posted by Koen Piller @ 7/13/2010 12:56:39 PM
RE: help on date and auto numbering.. Posted by JK M @ 7/13/2010 2:37:01 PM
RE: help on date and auto numbering.. Posted by Koen Piller @ 7/13/2010 3:03:03 PM
RE: help on date and auto numbering.. Posted by JK M @ 7/13/2010 3:15:09 PM
RE: help on date and auto numbering.. Posted by ho me @ 7/14/2010 5:58:21 PM
RE: help on date and auto numbering.. Posted by Christian Tabligan @ 7/15/2010 2:57:22 AM
RE: help on date and auto numbering.. Posted by JK M @ 7/15/2010 5:51:26 AM
RE: help on date and auto numbering.. Posted by Christian Tabligan @ 7/15/2010 6:20:28 AM