Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
enak
Starting Member
34 Posts |
Posted - 2006-03-30 : 12:54:52
|
| I need to find the max value of part of an integer. the format of the integer is ####mmyy where mmyy is monthyear. The #### is a count that starts at 1 for the first entry of each month of the year.I need to first find out if an entry exists for the current month. If one does then I need to find the max value of the #### part, then add 1 and then add the new record to the database.I don't know how to do this.Field Name: file_num int(4)Thanks,enak |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-03-30 : 14:22:06
|
| [code]select max(MyCol)from MyTablewhere MyCol%10000 = 1206[/code]CODO ERGO SUM |
 |
|
|
enak
Starting Member
34 Posts |
Posted - 2006-03-30 : 14:50:53
|
| Perfect. Thanks! |
 |
|
|
|
|
|