473,387 Members | 1,569 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,387 software developers and data experts.

problem with 0000-00-00 in 'Date' field ?

Hi,

I have a field in a table called 'ShipDate'.
This particular field has allow null set to no. So by default this
sets all the records to show 00/00/0000 in the field for each record
that has no data entered.

In my .asp pages I am trying to test against this empty field.

i.e.

If RS("ShipDate") = 0000-00-00
or
If RS("ShipDate") = 00/00/0000

The only thing that seems to work is if I am testing for records with
a date in that field,

If RS("ShipDate") > 0000-00-00
How can I test if that field is empty ?, nothing seems to work ?
Thanks
David
Jul 19 '05 #1
6 10037
BDR
Try testing against a string value instead of a numeric one...

If RS("ShipDate") = '0000-00-00'

http://www.mysql.com/doc/en/Using_DATE.html
David wrote:
Hi,

I have a field in a table called 'ShipDate'.
This particular field has allow null set to no. So by default this
sets all the records to show 00/00/0000 in the field for each record
that has no data entered.

In my .asp pages I am trying to test against this empty field.

i.e.

If RS("ShipDate") = 0000-00-00
or
If RS("ShipDate") = 00/00/0000

The only thing that seems to work is if I am testing for records with
a date in that field,

If RS("ShipDate") > 0000-00-00
How can I test if that field is empty ?, nothing seems to work ?
Thanks
David


Jul 19 '05 #2
BDR
Try testing against a string value instead of a numeric one...

If RS("ShipDate") = '0000-00-00'

http://www.mysql.com/doc/en/Using_DATE.html
David wrote:
Hi,

I have a field in a table called 'ShipDate'.
This particular field has allow null set to no. So by default this
sets all the records to show 00/00/0000 in the field for each record
that has no data entered.

In my .asp pages I am trying to test against this empty field.

i.e.

If RS("ShipDate") = 0000-00-00
or
If RS("ShipDate") = 00/00/0000

The only thing that seems to work is if I am testing for records with
a date in that field,

If RS("ShipDate") > 0000-00-00
How can I test if that field is empty ?, nothing seems to work ?
Thanks
David


Jul 19 '05 #3
In article <c1**************************@posting.google.com >,
da***@scene-double.co.uk says...
I have a field in a table called 'ShipDate'.
This particular field has allow null set to no. So by default this
sets all the records to show 00/00/0000 in the field for each record
that has no data entered.


Just a personal preference... but for a field that has an unknown value,
I prefer to use NULL in the field.

If IsNull(RS("ShipDate")) Then
Jul 19 '05 #4
In article <c1**************************@posting.google.com >,
da***@scene-double.co.uk says...
I have a field in a table called 'ShipDate'.
This particular field has allow null set to no. So by default this
sets all the records to show 00/00/0000 in the field for each record
that has no data entered.


Just a personal preference... but for a field that has an unknown value,
I prefer to use NULL in the field.

If IsNull(RS("ShipDate")) Then
Jul 19 '05 #5
you did not mention the column/field type for ShipDate

if character type ->
IF RS("ShipDate") = "00/00/0000"
if date type [not datetime]
IF RS("ShipDate") = {00/00/0000}

see if that works for you - your examples below were kinda weird to me.
hth - mondo regards [Bill]
--
William Sanders / Electronic Filing Group Remove the DOT BOB to reply via
email.
FREE LONG DISTANCE -> mailto:ex********@efgroup.net
Free Satellite Receivers and installation ->
http://www.vmcsatellite.com/?aid=58456
mySql / VFP / MS-SQL
"David" <da***@scene-double.co.uk> wrote in message
news:c1**************************@posting.google.c om...
Hi,

I have a field in a table called 'ShipDate'.
This particular field has allow null set to no. So by default this
sets all the records to show 00/00/0000 in the field for each record
that has no data entered.

In my .asp pages I am trying to test against this empty field.

i.e.

If RS("ShipDate") = 0000-00-00
or
If RS("ShipDate") = 00/00/0000

The only thing that seems to work is if I am testing for records with
a date in that field,

If RS("ShipDate") > 0000-00-00
How can I test if that field is empty ?, nothing seems to work ?
Thanks
David

Jul 19 '05 #6
you did not mention the column/field type for ShipDate

if character type ->
IF RS("ShipDate") = "00/00/0000"
if date type [not datetime]
IF RS("ShipDate") = {00/00/0000}

see if that works for you - your examples below were kinda weird to me.
hth - mondo regards [Bill]
--
William Sanders / Electronic Filing Group Remove the DOT BOB to reply via
email.
FREE LONG DISTANCE -> mailto:ex********@efgroup.net
Free Satellite Receivers and installation ->
http://www.vmcsatellite.com/?aid=58456
mySql / VFP / MS-SQL
"David" <da***@scene-double.co.uk> wrote in message
news:c1**************************@posting.google.c om...
Hi,

I have a field in a table called 'ShipDate'.
This particular field has allow null set to no. So by default this
sets all the records to show 00/00/0000 in the field for each record
that has no data entered.

In my .asp pages I am trying to test against this empty field.

i.e.

If RS("ShipDate") = 0000-00-00
or
If RS("ShipDate") = 00/00/0000

The only thing that seems to work is if I am testing for records with
a date in that field,

If RS("ShipDate") > 0000-00-00
How can I test if that field is empty ?, nothing seems to work ?
Thanks
David

Jul 19 '05 #7

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

Similar topics

0
by: | last post by:
I'm trying to scan a (binary) file for a string matching a particular pattern, and am getting unexpected results. I don't know if this is a bug or just my own misunderstanding of regular...
6
by: John Morgan | last post by:
I urgently need tom use SP3a upgrade the instance of SQLServer200 MSDE runing on my local machine but I am having problems in doing so. My first problem is that when I start the set up procedure...
9
by: GL | last post by:
I am running DB2 8.1.1 on AIX 5.1 Having a problem with a redirected restore. Once into the restore continue phase, I immediately get the following “SQL2059W A device full warning was...
37
by: Patrik Huber | last post by:
Hello! I got the following Code in Assembler (NASM), which prints out "5" in realmode: mov ax, 0xB800 mov es, ax mov byte , '5' I want to do the same in gcc now, but I'm stuck. GCC...
2
by: yezi | last post by:
HI all: I can not understand the following code , could explain to me in some easy way: unsigned long reflect (unsigned long crc, int bitnum) { // reflects the lower 'bitnum' bits of 'crc'...
0
by: Michael Rudolph | last post by:
Hi newsgroup, I try to connect to a host db2 (DB2 OS/390 7.1.2) from my db2 client on windows (DB2/NT 8.2.3). Using interactive mode everything works fine (db2, connect to abc user x using y,...
2
by: Jean-Marc Blaise | last post by:
Hi folks, On ESE **DPF** Aix 5L ML06, it seems that since I have applied FP12 + special build, I get this specific command not work and generate errors in db2diag.log (the command output is...
12
by: Henryk | last post by:
Hey there, I have some problems with the following code snippet on a Virtex-4 PowerPC with a GCC based compiler char chData; sprintf(&chData, "%+05.0f", -0.038f); --I get "-000" ???...
7
by: intrader | last post by:
The regular expression is /(?!((00000)|(11111)))/ in oRe. That is oRE=/(?!((00000)|(11111)))/ The test strings are 92708, 00000, 11111 in checkStr The expression used is checkStr.search(oRE). The...
3
by: lokeshrajoria | last post by:
hello everyone, i have problem with left shift...can you solve this.... i want to write a simple function which will give output is 32 bit frame: if input type == 0 -...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...
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,...

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.