473,597 Members | 2,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

storing data and time in datetime field

I am using MS Sql Express as the backend database for a Microsoft Access
front end application.

I am using a calendar control to store the desired date in the sql datetime
field. The time portion of the field defaults to 12:00am.

What I want is to also store the time in the same datetime field as the
date, but I want to use a separate control from the calendar control. I.e. I
want the user to choose the date from the calendar control, then select the
time from a different control, but have both the date and time stored in the
single datetime field of the SQL database.

So far, I can't get the time to concatenate with the date properly.

Any ideas?

Thanks,

John Tindall
Jan 16 '07 #1
3 5314
john wrote:
I am using MS Sql Express as the backend database for a Microsoft
Access front end application.

I am using a calendar control to store the desired date in the sql
datetime field. The time portion of the field defaults to 12:00am.

What I want is to also store the time in the same datetime field as
the date, but I want to use a separate control from the calendar
control. I.e. I want the user to choose the date from the calendar
control, then select the time from a different control, but have both
the date and time stored in the single datetime field of the SQL
database.
So far, I can't get the time to concatenate with the date properly.

Any ideas?

Thanks,

John Tindall
What are you trying? You should be able to just add them.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jan 16 '07 #2
Hello Rick,

Thanks for the reply. When I was trying to add the time, it was incrementing
the days, but it working now.
Now I just need to use access to display the long date (rather than general
date) as well as the time in the date field.

Thanks,
John

"Rick Brandt" <ri*********@ho tmail.comwrote in message
news:7p******** **********@news svr13.news.prod igy.net...
john wrote:
>I am using MS Sql Express as the backend database for a Microsoft
Access front end application.

I am using a calendar control to store the desired date in the sql
datetime field. The time portion of the field defaults to 12:00am.

What I want is to also store the time in the same datetime field as
the date, but I want to use a separate control from the calendar
control. I.e. I want the user to choose the date from the calendar
control, then select the time from a different control, but have both
the date and time stored in the single datetime field of the SQL
database.
So far, I can't get the time to concatenate with the date properly.

Any ideas?

Thanks,

John Tindall

What are you trying? You should be able to just add them.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

Jan 18 '07 #3
john wrote:
Hello Rick,

Thanks for the reply. When I was trying to add the time, it was
incrementing the days, but it working now.
Now I just need to use access to display the long date (rather than
general date) as well as the time in the date field.
That is controlled by the format property on forms and reports.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jan 18 '07 #4

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

Similar topics

2
1810
by: Robert | last post by:
I have no problem storing dates + times in a System.DateTime object. In addition, it's easy to output a Time as a string from an existing Date/Time. But I'm having trouble storing a time only. Is there any way to store only a time without the date portion (like 3:00 am) in this data structure? Or, if not, is there another data structure that would be preferable? Thanks
12
2375
by: pmud | last post by:
Hi, I am using teh following code for sorting the data grid but it doesnt work. I have set the auto generate columns to false. & set the sort expression for each field as the anme of that field... This grid displayes results based on users search.. public static int numberDiv; private void Page_Load(object sender, System.EventArgs e) {
6
1773
by: Jon Davis | last post by:
I like the drag-and-drop accessibility of dragging a table to a Web Forms designer and seeing a SqlDataAdapter automatically created for me.. being able to create a DataSet from that is fun and exciting, because now with this schema based data outline Visual Studio provides me with a typed class for managing data complete with Intellisense menus exposing my own field names as C# object properties ... cool .. Anyway, I have a problem. I...
6
3188
by: (PeteCresswell) | last post by:
User wants to go this route instead of storing pointers in the DB and the documents outside. Only time I tried it was with only MS Word docs - and that was a loooong time ago - and it seemed to me like there were performance issues at the time. How about the different types? The MS docs I would expect Access to differentiate and handle appropriately (i.e. .DOC and .XLS).. but how about ..PDF? and can I stash a .TXT document in the...
17
3532
by: Timothy.Rybak | last post by:
Hello all, This is my first attempt at an application, so kid gloves are appreciated. I need to make a very simple form that only has a few elements. One is TraceCode - a text field that is populated when a user scans a label. The other is ScanDate - a date/time field that should equal the date/time of the scan (e.g. 7/31/2006 5:00:00 AM).
4
1847
by: John A Grandy | last post by:
What are some best practices for storing pure dates and pure times in .NET ? I notice that DateTime.TimeOfDay() returns type TimeSpan , which is certainly sufficient for storing pure times , but not constrained ... Do people write their own classes ? Or have I overlooked one or more intrinsic .NET classes ?
0
8276
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
8259
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6698
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
5847
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
3889
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3932
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2408
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
1
1495
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1243
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.