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

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 5293
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*********@hotmail.comwrote in message
news:7p******************@newssvr13.news.prodigy.n et...
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
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. ...
12
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...
6
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...
6
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...
17
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...
4
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...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...

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.