473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

how to write table name?

I am using VB6 and Access n ADODB. Now...i have 12 tables to storing Invoice details. each table is called INV and is suffixed with month number ie INV01, INV02, INV03 etc...

Depending upon the Date of Invoice, the table to be used should be decided ie if the date is 08/02/2008 then that entry should be entered in the table INV02. How can this be done?
Feb 13 '08 #1
5 1010
werks
220 100+
I am using VB6 and Access n ADODB. Now...i have 12 tables to storing Invoice details. each table is called INV and is suffixed with month number ie INV01, INV02, INV03 etc...

Depending upon the Date of Invoice, the table to be used should be decided ie if the date is 08/02/2008 then that entry should be entered in the table INV02. How can this be done?
What is the format of your date? 08/02/2008 = Day/Month/Year

--
Kenneth
"Better Than Yesterday"
Feb 13 '08 #2
lotus18
866 512MB
Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim r As Date
  3.     Dim s As String
  4.  
  5.     r = #8/2/2008#
  6.     s = "INV" & Month(Format(r, "dd/mm/yyyy"))
  7.  
  8.  
Rey Sean
Feb 14 '08 #3
Killer42
8,435 Expert 8TB
Expand|Select|Wrap|Line Numbers
  1. Dim d As Date, s As String
  2. d = "8-Feb-2008"
  3. s = "INV" & Format(Month(d), "00")
  4.  
Feb 14 '08 #4
Expand|Select|Wrap|Line Numbers
  1. Dim d As Date, s As String
  2. d = "8-Feb-2008"
  3. s = "INV" & Format(Month(d), "00")
  4.  



so how do i write the sql query to insert that record in the concerned table???...
Feb 14 '08 #5
jamesd0142
469 256MB
so how do i write the sql query to insert that record in the concerned table???...
from what i can see with killer42's code... s will store the name of the table you need to populate:

so sql something like

"update " & s & " set <..remaining statement>"
Feb 14 '08 #6

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

Similar topics

2
by: sreddy | last post by:
I am trying to write a sql query on self referencing table. Just to brief ..Database is related to a Hiring department of the Qwest company. I need to generate a Report used by in HR...
3
by: francisco lopez | last post by:
I hope not sent I twice. ok here is my problem, the javascript form validation works perfect during I put a emaildirection in the <form action:""> comand, like this: <form...
13
by: Maroon | last post by:
Hi, I want to write a standard java user defined function, like this example:- select db_fun("roll"), roll from student; **db_fun() will work for all tables of the all databse here db_fun is...
10
by: sandraz444 | last post by:
I have an expression in the query under my form to autofill the date under a certain condition but it wont write to the underlying table?? The date shows in the form but not the table. Does anyone...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
1
by: anupamaavadutha | last post by:
hi all, iam new to javascript. i have problem calling javascript functions.iam designing a calender page.here is my code. <%@ page...
1
by: banging | last post by:
Hi there, I have a question regarding locking of tables so that when two or more people try to write or update the mysql tables, it locks up. Basically I only want one person to write to the...
6
by: globalrev | last post by:
i ahve a program that takes certain textsnippets out of one file and inserts them into another. problem is it jsut overwrites the first riow every time. i want to insert every new piece of...
2
by: Steve | last post by:
I want to open a window that has been pre-formatted with a table and then write rows to the table. The pre-formatted url is named budget.html and the body looks like this: <body> <h1...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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...

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.