Author: Grigore Dolghin
Posted: 2005-04-27 15:31:04 Link
Hi,
There is no "empty date" concept in SQL Server. I would modify the table to
accept nulls in that column.
Hope this helps.
----- Original Message -----
From: "Ailsom F. Heringer (Osklen)" <ailsom@osklen.com.br>
To: <profoxtech@leafe.com>
Sent: Wednesday, April 27, 2005 11:16 PM
Subject: Empty DATETIME column being saved with "1900-01-01 00:00:00"
I have a datetime column in a SQLSERVER table, opened via CursorAdapter in
VFP8. At a form, when I append a record, this column is saved with
"1900-01-01 00:00:00" even if the textbox control is empty.
There is no default value at the design of the column.
Any idea of what is happening?
Ailsom F. Heringer
ailsom@osklen.com.br
Analista de Sistemas
------------------------------------------
Osklen
Departamento de Informática
55 21 22198979
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.10.3 - Release Date: 25/4/2005
Author: Richard Kaye
Posted: 2005-04-27 15:33:13 Link
Have you looked at the values via Enterprise Manager? IIRC, VFP displays
a blank SQL date with that value but it's not really stored that way in
the back end.
Ailsom F. Heringer (Osklen) wrote:
>I have a datetime column in a SQLSERVER table, opened via CursorAdapter in
>VFP8. At a form, when I append a record, this column is saved with
>"1900-01-01 00:00:00" even if the textbox control is empty.
>
>There is no default value at the design of the column.
>
>Any idea of what is happening?
>
>
--
Richard Kaye
RFC Systems
Voice: 973.761.0868
Fax: 973.761.4329
For the fastest response time, please send your tech support
queries to techsupport@rfcsystems.com
---------------------------------------------------------
---------------------------------------------------------
Author: Jean Laeremans
Posted: 2005-04-27 16:01:12 Link
On Wed, 27 Apr 2005 23:31:04 +0300, you wrote:
>Hi,
>
>There is no "empty date" concept in SQL Server. I would modify the table to
>accept nulls in that column.
>
>Hope this helps.
Welcome to the list Griggie...
A+
jml
I need an empty datetime(). I've come up with the following only it
won't do math.
{//, 00:00:00}
DATETIME() - {//, 00:00:00} = 0
DATE() - {//} = 0
I don't really need to do the above calculations. I just want to be
able to check for EMPTY(mydatetime) which the above does.
--
Jeff
---------------
Jeff Johnson
jeff@san-dc.com
(623) 582-0323
www.san-dc.com
www.arelationshipmanager.com
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/514487D5.6010408@san-dc.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Jeff Johnson <jeff@san-dc.com> wrote:
>I need an empty datetime(). I've come up with the following only it
>won't do math.
>
>{//, 00:00:00}
>
>DATETIME() - {//, 00:00:00} = 0
>
>DATE() - {//} = 0
>
>I don't really need to do the above calculations. I just want to be
>able to check for EMPTY(mydatetime) which the above does.
{/:} is what I use to set a variable to am empty date time.
--
Tracy
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/d1cfb688-6543-40f3-b954-ef913074c9f2@email.android.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
just {} should do it
Al
-----Original Message-----
From: Jeff Johnson
Sent: Saturday, March 16, 2013 3:55 PM
To: profoxtech@leafe.com
Subject: Empty Datetime()
I need an empty datetime(). I've come up with the following only it
won't do math.
{//, 00:00:00}
DATETIME() - {//, 00:00:00} = 0
DATE() - {//} = 0
I don't really need to do the above calculations. I just want to be
able to check for EMPTY(mydatetime) which the above does.
--
Jeff
---------------
Jeff Johnson
jeff@san-dc.com
(623) 582-0323
www.san-dc.com
www.arelationshipmanager.com
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/55E95FB5A48E494B8D5228B4B1B471BA@gslredacer
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
At 07:55 2013-03-16, Jeff Johnson <jeff@san-dc.com> wrote:
>I need an empty datetime(). I've come up with the following only it
>won't do math.
Why should it? What would the answer be and why?
>{//, 00:00:00}
>
>DATETIME() - {//, 00:00:00} = 0
>
>DATE() - {//} = 0
>
>I don't really need to do the above calculations. I just want to be able to
Then, do not do them.
>check for EMPTY(mydatetime) which the above does.
Then, you have it.
Sincerely,
Gene Wirchenko
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/20130318163429.SRXQ1732.priv-edtnes25.telusplanet.net@edtncm04
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Isn't the difference between two dates the numeric number of days (ie not
a datetime)?
On Mon, Mar 18, 2013 at 12:34 PM, Gene Wirchenko <genew@telus.net> wrote:
> DATE() - {//} = 0
-Lew Schwartz
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAFuU78d++iVqeDEzZX=4Agbs+RsFAoJJ5BdYgRKQd8AK3nVQoQ@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
For datetime comparisons and indexing I just use ttoc(thedatetime, 1)
So to check for emptiness:
if ttoc(mydatetime, 1) = ttoc({/}, 1)
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/1363683401.14101.140661206235033.04AFEB3D@webmail.messagingengine.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Lew: That is what I meant by doing the math, but it doesn't. I would
expect date() - {//} to be = date(). It probably doesn't because it is
an "empty" date and not a valid date. As I mentioned previously I don't
intend to do math, I just want to be able to check for an empty datetime().
Thanks,
Jeff
---------------
Jeff Johnson
jeff@san-dc.com
(623) 582-0323
www.san-dc.com
www.arelationshipmanager.com
On 03/18/2013 10:08 PM, Lew Schwartz wrote:
> Isn't the difference between two dates the numeric number of days (ie not
> a datetime)?
> On Mon, Mar 18, 2013 at 12:34 PM, Gene Wirchenko <genew@telus.net> wrote:
>
>> DATE() - {//} = 0
>
>
>
> -Lew Schwartz
>
>
> --- StripMime Report -- processed MIME parts ---
> multipart/alternative
> text/plain (text body -- kept)
> text/html
> ---
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/51486A45.5060808@san-dc.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.