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

Date comparison does not work correctly??

Below is the output from command window. This shows values of variables and
result of comparison.

Make no sense except to dot.net.

Any ideas??

?pofile
#11/11/2003 12:39:22 PM#
?pdtdbdate
#11/11/2003 12:39:22 PM#
?pofile=pdtdbdate
False

Lloyd Sheen

Jul 21 '05 #1
8 1801
emg
It's possible that the display format lacks the same level of precision as
the actual variables. In other words, var1 may have hours, minutes, seconds
and hundreths of seconds while var2 either doesn't have hundredths of
seconds (:00) or the hundredths value differs.
"Lloyd Sheen" <sq*******************@tostopspamhotmail.com> wrote in message
news:dU******************@news01.bloor.is.net.cabl e.rogers.com...
Below is the output from command window. This shows values of variables and result of comparison.

Make no sense except to dot.net.

Any ideas??

?pofile
#11/11/2003 12:39:22 PM#
?pdtdbdate
#11/11/2003 12:39:22 PM#
?pofile=pdtdbdate
False

Lloyd Sheen

Jul 21 '05 #2
Full path of the date is -
1. Scan all files in several folders
2. Store date of last change in SQL Server
3. Retrieve date from SQL Server and compare to last change date of file

It is so hard to believe that data-in is not equal to data-out.

With dot.net everything that should be simple (at least according to MS) is
not.

Lloyd Sheen
"emg" <emg no sp**@comcast.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
It's possible that the display format lacks the same level of precision as
the actual variables. In other words, var1 may have hours, minutes, seconds and hundreths of seconds while var2 either doesn't have hundredths of
seconds (:00) or the hundredths value differs.
"Lloyd Sheen" <sq*******************@tostopspamhotmail.com> wrote in message news:dU******************@news01.bloor.is.net.cabl e.rogers.com...
Below is the output from command window. This shows values of variables

and
result of comparison.

Make no sense except to dot.net.

Any ideas??

?pofile
#11/11/2003 12:39:22 PM#
?pdtdbdate
#11/11/2003 12:39:22 PM#
?pofile=pdtdbdate
False

Lloyd Sheen


Jul 21 '05 #3
emg
You're assuming too much. You're reading in a timestamp from a file system,
storing it into a variable, passing it to SQL and storing it in a database.
Have you looked at the value:
a) on the file system
b) once it's in your .Net variable
c) once you've passed it to SQL (is it a stored procedure with a datetime
data type? a string datatype? or a straight SQL statement?
d) stored it in a sql variable (again, a dateTime? a smallDateTime? a
string?)

I've had problems in web pages passing dates back to SQL and losing
precision. It's not just "dotnet", it's the file system, dotnet and SQL all
passing data back and forth. This may not be the source of your problem but
I would certainly look at it more closely.
"Lloyd Sheen" <sq*******************@tostopspamhotmail.com> wrote in message
news:co*******************@twister01.bloor.is.net. cable.rogers.com...
Full path of the date is -
1. Scan all files in several folders
2. Store date of last change in SQL Server
3. Retrieve date from SQL Server and compare to last change date of file

It is so hard to believe that data-in is not equal to data-out.

With dot.net everything that should be simple (at least according to MS) is not.

Lloyd Sheen
"emg" <emg no sp**@comcast.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
It's possible that the display format lacks the same level of precision as the actual variables. In other words, var1 may have hours, minutes,

seconds
and hundreths of seconds while var2 either doesn't have hundredths of
seconds (:00) or the hundredths value differs.
"Lloyd Sheen" <sq*******************@tostopspamhotmail.com> wrote in

message
news:dU******************@news01.bloor.is.net.cabl e.rogers.com...
Below is the output from command window. This shows values of
variables and
result of comparison.

Make no sense except to dot.net.

Any ideas??

?pofile
#11/11/2003 12:39:22 PM#
?pdtdbdate
#11/11/2003 12:39:22 PM#
?pofile=pdtdbdate
False

Lloyd Sheen



Jul 21 '05 #4
Cor
Hi Lloyd,

Why you make it us so difficult to help you.

Now you are talking that it is about two different kinds of dataformats that
was the date comparissing about.

While I could not understand what could wrong, because you first presenting
it as strings or at least the same dataformats.

Do you have more hidden things in your solution from which we hear
afterwards?

Just my thoughts,

Cor

Jul 21 '05 #5
Lloyd Sheen wrote:
Any ideas??


Compare them as strings? <g>

-- Mark
Jul 21 '05 #6
That is what I ended up doing. If I check as poFile.ToString then there is
no problem.

"Mark Jerde" <ma********@verizon.no.spam.net> wrote in message
news:uf**************@TK2MSFTNGP10.phx.gbl...
Lloyd Sheen wrote:
Any ideas??


Compare them as strings? <g>

-- Mark

Jul 21 '05 #7
No hidden things. As in next post, comparing as strings fixes the problem.
It would be nice if data in matched the data out.

I am getting a value from System.IO for last updated time and storing it in
SQL Server. When I retrieve it to compare against the original (in most
cases) it is not the same. This is the problem. This kinda takes away from
the idea that what I store can be retrieved later and used to determine
processing paths.

I apologize if you think I am difficult. I just spent a weekend working
(fighting) with the IDE and all these problems do not help. What was a
simple implementation conceptually ends up taking twice the time and way too
many workarounds for me.

I appreciate all the help others give and if you notice I have answered
postings when I know the answer or a workaround.

Lloyd Sheen

"Cor" <no*@non.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi Lloyd,

Why you make it us so difficult to help you.

Now you are talking that it is about two different kinds of dataformats that was the date comparissing about.

While I could not understand what could wrong, because you first presenting it as strings or at least the same dataformats.

Do you have more hidden things in your solution from which we hear
afterwards?

Just my thoughts,

Cor

Jul 21 '05 #8
Cor
Hi Sean,

Thanks for your answer,

But different dateformats is not only a Net item.
There is almost always a data difference between a value stored on a disk
than in memory.

Only comparible types makes it posible to compare and therefore I was
thinking you was doing that by first converting the value's to date's (while
strings is even better and even more better strings which are trimmed on
both sides).

I was thinking on your question, did not understand why it went wrong, but
never thought about the idea that you where talking about data in different
data types.

And therefore I was not happy with your answer in the style if it was the
fault of others.

But no hard feeling, with this answer from you I will not ignore you nex
time when you have a question and help you if I can.

Cor
No hidden things. As in next post, comparing as strings fixes the problem. It would be nice if data in matched the data out.

I am getting a value from System.IO for last updated time and storing it in SQL Server. When I retrieve it to compare against the original (in most
cases) it is not the same. This is the problem. This kinda takes away from the idea that what I store can be retrieved later and used to determine
processing paths.

I apologize if you think I am difficult. I just spent a weekend working
(fighting) with the IDE and all these problems do not help. What was a
simple implementation conceptually ends up taking twice the time and way too many workarounds for me.

I appreciate all the help others give and if you notice I have answered
postings when I know the answer or a workaround.

Jul 21 '05 #9

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

Similar topics

2
by: Wiseguy | last post by:
I have an enum defined within a namespace. When I reference the enum using its qualified name graphics::db_status(VALUE) it does not work. If I say "using namespace graphics;" then I can resolve...
3
by: Lyn | last post by:
Hi, I am developing a project in which I am checking for records with overlapping start/end dates. Record dates must not overlap date of birth, date of death, be in the future, and must not...
3
by: Karl Gibbon | last post by:
Hi There, I currently have a database in Access 2002 with several forms. I would like to restrict access to one form in perticular until November 1st every year. My current method (attempted...
11
by: Bore Biko | last post by:
Dear, I have function that transform time from secconds to string formated as dd:hh:mm:ss (days:hours:minutes:seconds), but it doesent work correctly... Here s code compiled with gcc it goes...
8
by: Lloyd Sheen | last post by:
Below is the output from command window. This shows values of variables and result of comparison. Make no sense except to dot.net. Any ideas?? ?pofile #11/11/2003 12:39:22 PM# ?pdtdbdate
3
by: Tiya | last post by:
Hi there !!! I would like to know how to compare dates in javascript. var sdate = new Date(theform.SubmissionDate.value); var odate = new Date(theform.StartDate.value); var todaysdate = new...
22
by: semedao | last post by:
Hi , I am using asyc sockets p2p connection between 2 clients. when I debug step by step the both sides , i'ts work ok. when I run it , in somepoint (same location in the code) when I want to...
2
by: mikkaro04 | last post by:
hi.. i have a problem about date comparison in VB 6.0 and MS Access i want to compare dates from access to a date from DTpicker control in VB 6.0.. this is my code but it doesnt work coz i get a...
1
by: leosuth | last post by:
Hi I've got the following function: public static List<Order> FilterByDateRange(List<Order> _list,string _sdate, string _edate) { if (_list.Count == 0) return null; ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.