473,657 Members | 2,385 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exporting Date() to a Text File without exporting the time too

22 New Member
I am exporting a Query to a Text File. One of my fields is the current Date. F1:Date()

When I look at the text file, my date is displaying the System Date which includes the time.
Example: 10-29-2012 0:00:00

I only want to export the date portion but can't figure out how to get rid of the time portion.
Desired Result: 10-29-2012

In the query, I did try playing with the Field Properties with Format = Short Date and Input Mask = 99/99/0000, but this did not give me my Desired Result.

Any suggestions?
Oct 29 '12 #1
3 1987
NeoPa
32,568 Recognized Expert Moderator MVP
Use a string value from the Format() function. The Format property of a non-string field is only used in certain circumstances where humans are involved and doesn't change the fact that the field is intrinsically a Date/Time field. The value returned by the Format() function, on the other hand, is not a Date at all, but a string. Exactly what you require :-)
Oct 30 '12 #2
zmbd
5,501 Recognized Expert Moderator Expert
Build a calculated field in the query using the following:format([field],"yyyy-MM-dd") this will take the date value in the [field] and convert it to the string... in this case something like "2012-10-29"
http://msdn.microsoft.com/en-us/libr.../gg251755.aspx
Oct 30 '12 #3
zmbd
5,501 Recognized Expert Moderator Expert
Most Welcome...
That little format function is really usefull once the formating strings are mastered... take notice of the "sections" within the formatting string (about 1/2 thru the link) they will become usfull in alot of situations.
Oct 30 '12 #4

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

Similar topics

1
3956
by: nunYa | last post by:
I am trying to use the DoCmd.TransferText method to export an access table to a Tab Delimited Text File. I have put the code behind the onclick event of a button and keep getting the error "Run-time error '32027': Cannot update. Database or object is read-only" Code I using is: Private Sub ExportButton_Click()
2
1837
by: Jeffrey | last post by:
What classes/methods can I use to do the following? 1. Open a text file (less than 50k in size) 2. Replace some text in it. 3. Close the text file. I don't want to have to create a new file in order to accomplish this (i.e., I don't want to open it, read to memory, do replacement in memory, delete original file, write to new file from memory).
1
1618
by: =?Utf-8?B?UGF0cml4MzE3?= | last post by:
Caveat: newbie I would like to take the contents of the datagrid on my form and export it record by record to a flat text file. After some time searching, I came across two items: IO.File.WriteAllText System.IO.StreamWriter
17
1879
by: mustakbal | last post by:
How can I read only a section of a text file at a time.Say I have a text file of 1000 rows as database and I want to read from row 1 to 200 only, then maybe from 201- 275 and so on. What is the code that would use if I create a button that says 1-200. Thanks
3
4529
by: Tom | last post by:
I don't want to re-invent the wheel and am looking for a simple implementation of a text viewer or RichTextBox in read only mode that allows rapid file positioning within large data files without the time consuming and memory hogging associated with loading the entire file. Using the thumb to get close and then paging and scrolling to get exact placement within the file. Perhaps with only a few pages of data loaded into memory. I...
4
3325
by: mvvdsteen | last post by:
Hello all, I'm quite new to c++. I made a small program that will help me analyse wind tunnel data. But now I want this program to write to a text file. This works just fine, except it discards whatever is in the textfile at that time. I open the file, and then I go to the end, and write the stuff. I came up with the following code: ofstream logfile; logfile.open ("HWlog.txt"); logfile.seekp (0, ios::end); logfile << " " << endl;
5
2103
by: Myxamatosis | last post by:
Currently I need to read data from a file, such like this Measurements for Lansing, Michigan during April, 2000 63 32 0.00 54 43 0.10 59 39 0.00 46 24 0.00 52 20 0.00 54 30 0.00
0
716
by: rohitnegi09 | last post by:
when we upload the any file in asp.net then how to convert the format of any file in text document in asp.net.how is it possible?
4
1613
by: CD Tom | last post by:
This is driving me nuts!!! I have a table that one of the columns is set as Double, Fixed, 3 digits. I try and export this to a .txt file for a backup using the docmd.transfertext command but when I look at the file I only have 2 digits. What am I doing wrong and how can I get this to export 3 digits. Hopefully come one can give me an answer. Thanks for all your help.
4
2915
by: GeneticsJustin | last post by:
Hi everyone, I'm new to python and would like to split a FASTA (text) file into each different gene (separated by a ">"), randomly sample a certain number of the sequences, and print the result. I have the program almost working correctly, but for some reason text.split('>') strips all of the ">"s from the file. If there's some way I can either remove this strip or add back in the ">" character that would be amazing. Here's my program so far,...
0
8420
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8842
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7353
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.