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

Basic Date question

dgk
How do folks handle a situation where a Date that is a column in a
table isn't known for a particular row? Do we just leave it
uninitialized and have it show up in reports as 1/1/0001or something?
Jan 11 '06 #1
5 952
"dgk" <dg*@somewhere.com> schrieb:
How do folks handle a situation where a Date that is a column in a
table isn't known for a particular row? Do we just leave it
uninitialized and have it show up in reports as 1/1/0001or something?


Either use 'Nullable(Of Date)' as column type in .NET 2.0 or 'SqlDateTime',
which is nullable too.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 11 '06 #2
This sounds to me a question of preference. Leaving it uninitialized is
quite a good option. Since you know what the date is going to be you can
always make sure it's uninitialized.

You might also considering storing date in the numerical date format. This
way

20060110... The first four characters are year, then month, then day. It's a
perfectly logical way of storing a date and I use it quite often in my own
applications.

Cheers!
Cyril
Jan 11 '06 #3
dgk
On Wed, 11 Jan 2006 21:24:28 +0530, "Cyril Gupta" <no****@mail.com>
wrote:
This sounds to me a question of preference. Leaving it uninitialized is
quite a good option. Since you know what the date is going to be you can
always make sure it's uninitialized.

You might also considering storing date in the numerical date format. This
way

20060110... The first four characters are year, then month, then day. It's a
perfectly logical way of storing a date and I use it quite often in my own
applications.

Cheers!
Cyril

I thought about that but we're going to use Crystal Reports and SQL
Reporting Services and those aren't going to like that format.

Jan 11 '06 #4
dgk
On Wed, 11 Jan 2006 16:49:45 +0100, "Herfried K. Wagner [MVP]"
<hi***************@gmx.at> wrote:
"dgk" <dg*@somewhere.com> schrieb:
How do folks handle a situation where a Date that is a column in a
table isn't known for a particular row? Do we just leave it
uninitialized and have it show up in reports as 1/1/0001or something?


Either use 'Nullable(Of Date)' as column type in .NET 2.0 or 'SqlDateTime',
which is nullable too.


The database is actually Cache (Intersystems) so I'm not sure how that
would translate. I'll find out.
Jan 11 '06 #5
dgk,

A dateTime that is empty in a datatime field in a datarow = DBNull.Value
A dateTime field in a normal Net datatime field that is not initialized =
Nothing,

I hope this helps,

Cor
Jan 11 '06 #6

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

Similar topics

0
by: Ray | last post by:
Date problem. Using non American date formats with Microsoft Access and Visual Basic. I set my regional settings to English(Ireland) or English(United Kingdom) and my date appears in Access as...
8
by: Cherrish Vaidiyan | last post by:
hello googles, I have a small sqlplus problem. i have created a table with date field along with other varchar2,number etc. But unfortunately i made a mistake in entering the date. for some date...
4
by: Ramesh | last post by:
hi, Let me ask some basic questions. Can anybody explain me about the following questions: 1. When we have to create sn key? Whenever we compiled Component we have to create or it is a one time...
4
by: Mark Fox | last post by:
Hello, I've noticed in some sample code that sometimes people use the @ before a string when concatenating them. Example: string filePath = Appl.Request.PhysicalApplicationPath + @"bin\" +...
5
by: Aussie Rules | last post by:
Hi, Having a mental block on this one. Have done it before but can't rack my brain on how... I have an object, with a bunch on property, and I add that object to a combo box. I want the...
4
by: aamircheema | last post by:
Hi, Say I have a table Job with columns name, date, salary . I want to get the name ,date and salary for the date when that person earned maximum salary. I am using something like SELECT...
10
by: trippeer | last post by:
I have the source code to an old BASIC program that a friend of mine would like to run online. I am a beginner at JS, but I think that it would be a good choice for the project. My background is in...
10
by: ZaphodBBB | last post by:
Hi again Can I create a recordset (which I find a lot easier to manipulate) from an SQL statement? (instead of a querydef). I have a subform that has reviews of job (service checks) on it. Each...
5
by: umeshj99 | last post by:
Hi! I am using SQL Server 2005 express edition as backend and Visual Basic 2005 express edition as frontend. This question is related to date comparison. SELECT IssueDate, Client, ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...

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.