473,408 Members | 2,839 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,408 software developers and data experts.

Data Formating In Query

Hello all I have a little formating problem. I have a query with the following code for one of the fields

Expand|Select|Wrap|Line Numbers
  1. IIf(DatePart("ww",[InitShoppingWO]![WORDER_OUTSHOP_DATE],2,2)=53,"1", 
  2. (DatePart("ww",[InitShoppingWO]![WORDER_OUTSHOP_DATE],2,2)))
  3.  
This code should generate a number and allow me to use greater then less then to find groups of Fiscal Weeks. The problem is that access is seeing the result of this code as text so my searches are messed.

Is there a way to tell access what format I want the output to be?

Thanks
Mar 17 '08 #1
3 1184
MindBender77
234 100+
Hello all I have a little formating problem. I have a query with the following code for one of the fields

Expand|Select|Wrap|Line Numbers
  1. IIf(DatePart("ww",[InitShoppingWO]![WORDER_OUTSHOP_DATE],2,2)=53,
  2. "1",(DatePart("ww",[InitShoppingWO]![WORDER_OUTSHOP_DATE],2,2)))
  3.  
This code should generate a number and allow me to use greater then less then to find groups of Fiscal Weeks. The problem is that access is seeing the result of this code as text so my searches are messed.

Is there a way to tell access what format I want the output to be?

Thanks
You can use "Format" to modify the data type.

See this link for more help: Formatting

Bender
Mar 17 '08 #2
Scott Price
1,384 Expert 1GB
You can also use one of the convert functions: CInt() changes to Integer, CLng() to Long Integer, etc.

Regards,
Scott
Mar 17 '08 #3
NeoPa
32,556 Expert Mod 16PB
My system's playing up so I can't check this, but the true part of your IIf() is a string literal ("1"). This probably convinces Access to treat the result as a string value. If you change this to be simply 1 then i suspect the value would resolve to a number.
Mar 18 '08 #4

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

Similar topics

6
by: Polar | last post by:
I have a database that stories entries of short stories for a writers website. I can easily input the data into MYSQL but my trouble lies in retrieving the data. the story in just cut and...
3
by: Dan Gidman | last post by:
Okay all I have a problem. I have two list of adresses and phone numbers. I do not have control over the contents of the lists The only unique field between the two is the phone number. I need...
5
by: Jonny | last post by:
Hello, I have created a button on my form which when pressed does the following : 1) Run a pre-defined Macro, which is picking up a query and running my data to excel. However, I need the...
0
by: rose | last post by:
I have an ACCESS graph and when I turn on show data tables, the data table displays a whole number instead of the percentage like the graph. I have formatted the sourc query to be percentage, but I...
5
by: James | last post by:
I have a Continuous form in Access 2000. The form contains a date field and the user has requested( demanded nicely) that they want the date field to be yellow if there is no data in the field....
10
by: Tyler | last post by:
Hello All: After trying to find an open source alternative to Matlab (or IDL), I am currently getting acquainted with Python and, in particular SciPy, NumPy, and Matplotlib. While I await the...
4
by: seth_hickel | last post by:
With other solutions I would get a recordset, read each record and display data by formating my html as I wanted to display values of each record. I am trying to display data in a three column...
1
by: Shawn Northrop | last post by:
I just read an article on kirupa.com about incorporating mySQL and PHP with flash. I am dynamically loading conent into a flash movie and am not sure how to format. In my php code i have: $y = "";...
2
by: Dhananjay | last post by:
Hi all , I have got problem when i am tring to exportGridview Data into Excel format. It is going into text format ,but what i want is if the field is number/currency then it should go into...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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...
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...

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.