473,763 Members | 8,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sequence number +1 based on query on other table

Hi i would like to add a new table (TRADE_SEQ) to my document management database which would contain a squential number in the format currentyear#### so it would start at 20100001. The next sequence number would be generated automatically when the largest one on this table has records against it in another table.

This would allow the user to save all documents for one trade against the currentyear#### code and allow quick searching.

Im happy creating the table and adding the field to the profile and search form its the seq+1 if records against the largest exist in the other table

Many thanks in advance
Sep 30 '10 #1
1 1456
gpl
152 New Member
You are storing 2 values in the 1 field, the year and the sequence number

Far better that you have 2 columns, one for the current year and one for the sequence, your front end can then worry about the formatting and presentation.

You can use a trigger to calculate and store these 2 values
Oct 1 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
5773
by: Robert McGregor | last post by:
Hi there, I was wondering if anyone could help with this problem. I have a table with about 250,000 rows that relate to files that have been processed elsewhere in our business. Each file has a sequence number as part of the file name that goes from 0000 to 9999 then back to 0000. I want to output a list to tell me the missing entries in that list
4
7732
by: Kamran K | last post by:
Hello I have created a client server application using C#. Existing application is using random number on client side to generate sequence numbers that are then assigned to transactions. This results in duplicate sequence numbers across multiple users. Solution to this problem is to generate the sequence number on the server. Since this is not an ASP app, I cannot use Global.asax Application object to keep track of begin application.
9
1711
by: VMI | last post by:
We have this huge application that's based on storing tons of data on a dataTable. The only problem we're having is that storing LOTS of data (1 million records) into a datatable will slow down the system since all this data will be stored in memory. The performance is really affected with this. Since we don't really want to redesign everything based on this datatable, are there any companies that offer a product similar to the datatable...
1
9861
by: furqonk | last post by:
I have query like below: SELECT part_no,part_nm,qty FROM tb_stok_out ORDER BY part_no as result: part_no part_nm qty aaa asdfd 3 abab sdfsdf 4 abab adfdf 5
5
2045
by: SeanCly10 | last post by:
Hi all. I don't want to sound like a complete idiot here, but I'm somewhat limited in my coding knowledge, and I need some advice and help. I'm working on a database that will eventually be used to hold patient information for research purposes. What I'm trying to do is create a form-based query system that will be easier (and less dangerous) for my future users to use to search the patient information. Let me outline the specifics,...
5
2280
by: Stephen | last post by:
Hello, I have 2 tables, one contains log of all incoming phone calls, and the other one is simply a phone book. I want to fetch caller's name if it's already exist in the phone book, and if it doesn't exist yet just fetch caller's phone number. Is it possible to do this in just a single query? Something like: SELECT Switch((SELECT count(a.*) FROM phone_log a, phone_book b WHERE
3
21000
by: hgriva | last post by:
Hi, I have a table TARGET whose structure is seq_no number -- should be populated with sequence SEQ_TAR fsa varchar2(10) Table SOURCE structure is ------------------------- fsa varchar2(10)
21
1604
by: bilgekhan | last post by:
After doing a succcessful insert() or find() on a set<Tcontainer is it possible to get the item number of this item in the set? (ie. its zero-based sequence number (position/location/rank/index) within the sorted collection) Additional info: insert() returns a pair<Tand find() returns an iterator. Using any of these two objects is it possible to get the sequence number of the item these objects point to? After the insert() or find()...
1
1790
by: kama | last post by:
I want to create sequence number for repeating data values. This sequence number will re-start from 1 for each new value. Example as below:- Amount sequence_number 200 1 200 2 100 1 500 1 500 2 500 3 500 4
8
2356
by: eneyardi | last post by:
How to transfer automatically the record to other table? i have table name tblDTS and tblARC my form name is List the default view is Split Form and another form name is Entry the default view is Single Form i have two fields: subject and status in my entry form i have one textbox for subject and one combobox for status, you have two option to select in this combobox (done and pending) my datasource is tblDTS. when add record and i select...
0
9564
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9387
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10002
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.