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

Formating date in report

1
I have two fields in my table
[OrderDate] and [OrderTime]
The date is stored as for example
06/06/2007 and time as 16:04 (the format and input mask are set to "short date" and "short time" respectivelly)

I would like the date to show in a report as
dd.mm.yyyy-HH:nn (e.g. 24.05.2007-17:06)

How do i do that? Thanks in advance!
Jun 12 '07 #1
5 1427
FishVal
2,653 Expert 2GB
I have two fields in my table
[OrderDate] and [OrderTime]
The date is stored as for example
06/06/2007 and time as 16:04 (the format and input mask are set to "short date" and "short time" respectivelly)

I would like the date to show in a report as
dd.mm.yyyy-HH:nn (e.g. 24.05.2007-17:06)

How do i do that? Thanks in advance!

Hi!

You should use Format function in the report RecordSource query on in the report control representing the date.

Hereby an example of query

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT tblTable1.*, Format([tblTable1]!dteDate,"dd\.mm\.yyyy-hh\:nn") AS dteFormattedDate
  3. FROM tblTable1;
  4.  
  5.  
Jun 12 '07 #2
hyperpau
184 Expert 100+
I have two fields in my table
[OrderDate] and [OrderTime]
The date is stored as for example
06/06/2007 and time as 16:04 (the format and input mask are set to "short date" and "short time" respectivelly)

I would like the date to show in a report as
dd.mm.yyyy-HH:nn (e.g. 24.05.2007-17:06)

How do i do that? Thanks in advance!
You don't need to have separate fields for this.
Go to design view of the table and set the format of the fields as follows:

[OrderDateTime]
Format: dd\.mm\.yyyy-hh\:nn
Input Mask : 99/99/0000\ 99:99;0;_

Then on your report, it will automatically show it like how you want it to be
assuming your report is bound to this table
Jun 13 '07 #3
FishVal
2,653 Expert 2GB
You don't need to have separate fields for this.
Go to design view of the table and set the format of the fields as follows:

[OrderDateTime]
Format: dd\.mm\.yyyy-hh\:nn
Input Mask : 99/99/0000\ 99:99;0;_

Then on your report, it will automatically show it like how you want it to be
assuming your report is bound to this table
Sure.
You've obviously meant report.field.format property. Am I right?
Jun 13 '07 #4
hyperpau
184 Expert 100+
Sure.
You've obviously meant report.field.format property. Am I right?
I don't really know if you get me. But it would not be needed to
done in the VBA codes of the report but on the
design view of your tables itself. :)
Jun 13 '07 #5
FishVal
2,653 Expert 2GB
I don't really know if you get me. But it would not be needed to
done in the VBA codes of the report but on the
design view of your tables itself. :)
I've meant format property of report field which could be set in report design view.
A date supposed to appear in the desired format in report, isn't it?
So, there is no reason to make changes in the table design. Changing table field format property may affect report field format property in two ways:
  • when you set field property in table design view Access will display smarttag suggesting the changes to be passed to all correspondent objects (forms, reports etc)
  • when your create a new report from table/query Access will set the report field properties according to that in table

Format of report field is not the same as format in table view field.
This is what I've meant. Sorry if was unclear.

P.S. Of course, my suggestion in msg#2 is not an optimal one.
Jun 13 '07 #6

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

Similar topics

6
by: David B | last post by:
I have a report with 2 sub reports on it. The report is an invoice and the sub reports are dropping data onto the invoice. This worked fine if generating 1 invoice at a time. I am trying to create...
3
by: manning_news | last post by:
Using A2K. I've been asked to modify a report currently requiring only one date parameter to now accept a date range. The main report has 2 subreports and is not bound to a table or query. The...
0
by: KK | last post by:
Hi, I am displaying a crystal report based on XML data In XML I will get the date in this format. <DOB>1946-05-22T00:00:00.0000000-04:00</DOB>...
4
by: vp | last post by:
Hi all, I need to create a report by extracting data from a table. I am using the utility EXPORT to pull data from table to a file. I will need to get the column heading and also if I want to...
3
by: Smiley | last post by:
Hi, I know how to do confitional formating in Excel by clicking the wizard. Is this possible in MS Access ? If so, please directly where to look. I found example but nothing as to how to do it....
3
by: pv1 | last post by:
Hello, I am somewhat new to Access and vba, but am trying to complete a request that has been made of me. Access version 2002 WindowsXP. At this point these text boxes are bound to the table...
2
by: FNA access | last post by:
I have a request to highlight any entries in a report that have the same date. The report is sorted by date so the records would be one after the other. I cannot find any events for the report that...
6
by: sphinney | last post by:
I'm trying to change the font color of a textbox on a report to red if the date displayed in the textbox is before today. I'm using the following code to accomplish this: Dim Ctrl1 as Textbox...
1
by: gtslabs | last post by:
I have a report with 2 subreports The first subreport has 3 fields (Expr1, Field1, Field2) Where Expr1 is a Date I want to highlight the 3 fields if a date is within a range of 2 dates. I was...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.