|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Basic Date questionHow 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? "dgk" <d**@somewhere.com> schrieb: Either use 'Nullable(Of Date)' as column type in .NET 2.0 or 'SqlDateTime', > 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? which is nullable too. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> On Wed, 11 Jan 2006 16:49:45 +0100, "Herfried K. Wagner [MVP]"
<hirf-spam-me-here@gmx.at> wrote: >"dgk" <d**@somewhere.com> schrieb: The database is actually Cache (Intersystems) so I'm not sure how that>> 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. would translate. I'll find out. 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
Show quote
Hide quote
On Wed, 11 Jan 2006 21:24:28 +0530, "Cyril Gupta" <nom***@mail.com> I thought about that but we're going to use Crystal Reports and SQLwrote: >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 > Reporting Services and those aren't going to like that format. 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
Inheritance
What happened to the Class view in VS2005? Clean up issues Two Relatively Simple Questions VB 2005 - How to hook into Windows to intercept all mouse events? Hide Window form (top most) Novice Question About Webclient A place to discuss future vb featuresause? Menu is disapearing in 2005 Thread management in a Windows service |
|||||||||||||||||||||||