473,516 Members | 2,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using a constant field

Hi Planet!

I have created a table (see test script below)

I have an Id field that will contains numerical values.
For reason behond my control This field has to have a
constant hard coded letter V in front of it.

V4789
V0023
ect...

Is there a way know to man kind to do this and
avoid storing 100 000 letter V for nothing...
And maybe keep a INT type rather than it becoming
VARCHAR or CHAR.

thanks for your help.
CREATE DATABASE JK_PROD;
USE JK_PROD;

CREATE TABLE VOUCHERS (
Id INT(8),
Marketing_Code VARCHAR(15),
Date_Created DATETIME,
Date_Used DATETIME,
Account_Nb VARCHAR(10) NOT NULL,

PRIMARY KEY(Id)
);

CREATE UNIQUE INDEX IDX_VOUCHERS ON VOUCHERS (Id);
INSERT INTO VOUCHERS VALUES
('','mrk code 1','2004-01-01','2004-01-02','AC01');
INSERT INTO VOUCHERS VALUES
('','mrk code 2','2004-01-01','2004-01-02','AC02');
INSERT INTO VOUCHERS VALUES
('','mrk code 3','2004-01-01','2004-01-02','AC03');
Jul 19 '05 #1
0 1518

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
356
by: Fred | last post by:
Hi Planet! I have created a table (see test script below) I have an Id field that will contains numerical values. For reason behond my control This field has to have a constant hard coded letter V in front of it. V4789 V0023
5
2112
by: Roger Leigh | last post by:
I've written a simple container template class to contain a single value. This emits a signal when the value is changed (it's used as a notifier of changes), and listeners can connect to its changed signal. i.e. field<int> i(2); i = 4; // field<int>::m_value = 4; changed signal is emitted. Currently, the contained value may be accessed...
3
23998
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked tables in the database where the code resides. If we move the database with the data tables to a new directory, the links are no longer valid. I...
2
6132
by: Johm | last post by:
Can i use a constant in a query ? I have a constant Public Const rate As Double = 10 Can i use it in the query ? I want to multiply the field with the constant rate, but Access does not accept the rate as a constant, instead it always put it into brackets as it is a field. I tried to write rate in sql, but after that access shoewed...
11
6554
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am...
1
4002
by: Daveyk0 | last post by:
Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the live databases on the network. Is there a way, via code, when I get back in-house from being on the road to click a button, and select the backends...
5
3923
by: Paul E Collins | last post by:
I have a class hierarchy representing data importers, each of which reads lines from a particular type of comma-separated data file and creates corresponding entries in a database. There is an abstract base class, Importer, which contains the file-reading logic, and a series of inherited classes - CarrierImporter, RouteImporter, etc. - that...
13
4997
by: Kantha | last post by:
Hi all, I have declared an Union as follows typedef union { struct interrupt_bits { unsigned char c_int_hs_fs_status : 1, c_setup_intflag : 1,
65
3839
by: Arjen | last post by:
Hi, Form a performance perspective, is it wise to use the ref statement as much as possible? Thanks! Arjen
7
2795
by: John Koleszar | last post by:
Hi all, I'm porting some code that provides compile-time assertions from one compiler to another and ran across what I believe to be compliant code that won't compile using the new compiler. Not naming names here to remove bias - I'm trying to tell if I'm relying on implementation defined behavior or if this is a bug in the new compiler. ...
0
7276
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...
0
7182
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...
0
7408
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. ...
0
7548
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3267
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...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
488
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...

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.