473,411 Members | 1,899 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,411 software developers and data experts.

strange column names and DataType problems

Hello,

I am using MS Access 2003 with VBScript. I have quite strange column names
which are: 1,2,3,4,etc... Data Types of the columns are Yes/No and formats
True/False. The first thing I want to do is count rows with True in column
1, then column 2, etc. My query is: "SELECT count(*) AS ile FROM profiles
WHERE 1 = True" It doesn't work. I tried to have it 'True' - the same. When
I list all the values it simply says True or False. Any ideas?
The second thing is inserting a new column of the same type. I have: "ALTER
TABLE profiles ADD 100 -?-" How to declare column 100 to have it as the same
DataType and format as the ones before. I am using 'bit' for the time being,
which is not a perfect solution. Any ideas?

Piotr Kurpiel
Pi***********@cern.ch
Nov 13 '05 #1
2 1699

Try to avoid having col names as 1,2,3 etc. Instead use One,two,three

Madhivanan

Nov 13 '05 #2
Piotr Kurpiel wrote:
Hello,

I am using MS Access 2003 with VBScript. I have quite strange column names
which are: 1,2,3,4,etc... Data Types of the columns are Yes/No and formats
True/False. The first thing I want to do is count rows with True in column
1, then column 2, etc. My query is: "SELECT count(*) AS ile FROM profiles
WHERE 1 = True" It doesn't work. I tried to have it 'True' - the same. When
I list all the values it simply says True or False. Any ideas?
The second thing is inserting a new column of the same type. I have: "ALTER
TABLE profiles ADD 100 -?-" How to declare column 100 to have it as the same
DataType and format as the ones before. I am using 'bit' for the time being,
which is not a perfect solution. Any ideas?


Try enclosing the field names in square brackets, ie:

SELECT count(*) AS ile FROM profiles WHERE [1] = True

However, Madhivanan's point should be considered for field names
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #3

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

Similar topics

14
by: Sanjay Minni | last post by:
What is the datatype to be used for Primary Key columns for most optimised access given that - There will be a single column primary key only - The values will only be integers (but as...
1
by: ksedran | last post by:
Hi All, I am seeing a very strange issue with a winform I have. There are a few statements in the code, that at one point were working just fine. I had compiled the code a few days ago and...
3
by: Gary Besta | last post by:
I am trying to add a simple case statement to a stored procedure or user defined function. However when I try and save the function/procedure I get 2 syntax errors. Running the query in query...
3
by: Bill C. | last post by:
Hi, I've got a simple console app that just reads an XML file into a DataSet then prints out a description of each table in the DataSet, including column names and row values for each column. ...
4
by: Brian Brane | last post by:
I have properties that wrap DataRow columns as in: public int aNumber { get{ return m_DataRow; } set{ m_DataRow = value; } } If the column happens to contain DBNull, I get a cast exception...
6
by: Robert Schuldenfrei | last post by:
Dear NG, After being away from C# programming for a spell, I am trying my hand at what should be a simple task. I have been hitting my head against the wall this morning. I have a simple order...
1
by: Larry Bird | last post by:
I've created a AlertDataClass below within the class I have tables and column that I've create. In the AlertDataAccess class I'm trying to insert data into my tables. AlertDataAccess is a Module...
0
by: zacks | last post by:
I am trying to use the Microsoft Text Driver to access data in a text file via ODBC calls. Everything has worked fine so far. I am now trying to implement support for a file that has a special...
4
by: UJ | last post by:
I have a datatype that I want to use as a type for a column (It's an enumeration.) but I can't get the syntax right. Can you even do it? Or do I need to do it as a string and convert it back and...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.