jai kushwaha
Registered User.
- Local time
- Today, 18:47
- Joined
- Nov 1, 2015
- Messages
- 61
hello my dear friend i want that in the place of year the ID no will start again from 1/4/year. i mean every 1st April the ID will start again in the place of 1st January.Let me be the first to harass you with this question: Why?
Is this id going to be used externally to the database? Will people in meetings reference 1015/0712 and others know what they are talking about? In short, does this really serve a real need?
Regardless, the way to accomplish what you want is to not to not do it all at once, nor in one field (RIMID). You wouldn't have one field in your table that stores this value (e.g. "1015/0712"). Instead you would store it in 2 fields--1 for each discrete piece of data that goes into making it. Let's call those RIYEAR and RIINC.
In RIYEAR you would store the actual year (e.g. 2015, 2016, etc.). Then in RIINC you would hold the incrementing portion. This would be an integer data type and store values like such: 1, 2, 3...712...). Then to get the next RIINC value its a simple DMAX call using RIYEAR as criteria.
Then, when you wanted to display this id, you would create a function that you pass both RIYEAR and RIINC values. It would then construct your RMID in the manner you prescribed.
Again, though, why?
what to do and how to do ?? please help i got the previous one please help me for this one as fast as possible i need it really fast.
Thanks for your support friend.