Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How to change the datatype in a query?

13 Apr 2010   #1
Aisha00

Windows XP
 
 
How to change the datatype in a query?

Hello everyone, I was doing an assignment in which i created a query and performed a calculation in it; the answer of the calculation should be as an integer whereas the answer i got is suppose "6.7779999", if i'm not wrong the only way to change my answer to an integer is by changing the data type, and i spend about half an hour trying to find a way to do so but in vain, so i was wondering if anyone here could please help me out. Thankyou


P.s- I've been using office for quite some time now but the sql thing is pretty new to me, so if anybody suggests making any changes to it, can you tell me how exactly to do it aswell please? and bt the SQL view for my query is provided at the end and i wanna change the data type of hours worked to integer ..... SELECT DISTINCT Technician.[Technician Number], Technician.[Last Name], Technician.[First Name], Technician.[Hourly Rate], Technician.[YTD Earnings]/[Hourly Rate] AS [Hours Worked]
FROM Technician
GROUP BY Technician.[Technician Number], Technician.[Last Name], Technician.[First Name], Technician.[Hourly Rate], Technician.[YTD Earnings]/[Hourly Rate]
ORDER BY Technician.[Last Name];


My System SpecsSystem Spec
.
13 Apr 2010   #2
not so gray matter

W7 Ult. x64 | OS X
 
 

Not sure if this is what you're looking for:

Quote:
I have a field CMS_STDY_PRD

In my query I want to
1) change the data type to character
and
2) give the field an Alias of Study_Period.

How do I change the data type in a qry?
Is it possible to change the data type and the field name in the same step?

JZ

RESPONSE

If you mean you only want the change to happen in the query results and not
have any effect on the actual data stored the table.

Field: Study_Period: CMS_STDY_PRD & ""

In an SQL statement that is

SELECT CMS_STDY_PRD & "" as Study_Period, ...
My System SpecsSystem Spec
13 Apr 2010   #3
Aisha00

Windows XP
 
 

Quote   Quote: Originally Posted by notsograymatter View Post
Not sure if this is what you're looking for:

Quote:
I have a field CMS_STDY_PRD

In my query I want to
1) change the data type to character
and
2) give the field an Alias of Study_Period.

How do I change the data type in a qry?
Is it possible to change the data type and the field name in the same step?

JZ

RESPONSE

If you mean you only want the change to happen in the query results and not
have any effect on the actual data stored the table.

Field: Study_Period: CMS_STDY_PRD & ""

In an SQL statement that is

SELECT CMS_STDY_PRD & "" as Study_Period, ...
Isn't that only for the alias?, i might be wrong...i'm sry, its just tht i'm kinda new to all this!
My System SpecsSystem Spec
.

14 Apr 2010   #4
Bill2

Windows 7 x64 pro/ Windows 7 x86 Pro/ XP SP3 x86
 
 

In Access, you can use the ROUND function with the appropriate parameter to get your desired result. Read this.

Access: Round Function
My System SpecsSystem Spec
Reply

 How to change the datatype in a query?




Thread Tools




Similar help and support threads
Thread Forum
A RAM query
This is going to sound real dumb but I bought what I thought was 2GB of DDR form a US site for $20 now I should have read the ad a bit more carefully but whats done is done. What I would like to know though is why does high density RAM not work the same as low density I always thought RAM was...
Hardware & Devices
Query
Hiyya everyone - I got this request from a friend who I personally think is wasting his dough and although I can help him a bit (had no idea of costs as you will see) the only thing I cannot help is with the driver/s he wants. I did suggest he come on here but anyway his message - You might...
Drivers
WLM query
Can't find a thread related so.. 1. My new mail message to send opens in full screen and I cannot find a way of reducing it to a manageable size even on 21.5" it is ridiculous. 2. When I try to attach pics I get the photo album "version" how can I just attach a pic from my camera or saved...
Browsers & Mail
VPN Query
Hi folks, Can anyone tell me if it's possible for multiple users to edit & save an excel spreadsheets over a VPN conection. I have enabled sharing of the sheet but the data does not merge, the ammendments remain unique to the individual users machines. Any advice greatly appreciated.
Network & Sharing
Query
:D hi every body, I Have windows 7 ultimate running on 1.5 gb ram,320 gb(4 partitions) westerndigitals HDD(on INTEL D915GAV motherboard). Its been a month i installed win7 ultimate.I hadnt installed anything on C: drive which is of 60gb capacity.But the free space is decreasing day after...
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 10:39.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App