473,569 Members | 2,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=pdtdbda te
False

Lloyd Sheen

Jul 21 '05 #1
8 1816
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************ *******@tostops pamhotmail.com> wrote in message
news:dU******** **********@news 01.bloor.is.net .cable.rogers.c om...
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=pdtdbda te
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.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP09.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************ *******@tostops pamhotmail.com> wrote in message news:dU******** **********@news 01.bloor.is.net .cable.rogers.c om...
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=pdtdbda te
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************ *******@tostops pamhotmail.com> wrote in message
news:co******** ***********@twi ster01.bloor.is .net.cable.roge rs.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.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP09.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************ *******@tostops pamhotmail.com> wrote in

message
news:dU******** **********@news 01.bloor.is.net .cable.rogers.c om...
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=pdtdbda te
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********@ver izon.no.spam.ne t> wrote in message
news:uf******** ******@TK2MSFTN GP10.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******** ********@TK2MSF TNGP11.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
1693
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 the name of the enumeration and its values. The following code demonstrates the problem: #include <db_RO.hpp>
3
11574
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 overlap existing records from the same table. I had this all working some time ago, but recently when I have gone back to do more testing, part of...
3
6553
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 method) is a heavy handed, no nonsense, direct date comparison using VBA. Function NovemberOnwards() 'Use with 'On Avtivate' on Orders form ...
11
1840
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 (if you name program as "transform"), transform 1000, for 1000 seconds...
8
394
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
10218
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 Date(); if(sdate < todaysdate)
22
3996
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 receive 5 bytes buffer , I call the BeginReceive and then wait on AsyncWaitHandle.WaitOne() but it is signald imidiatly , and the next call to...
2
2707
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 syntax error.. "Select * from Reservations where DateCheckIn <= #date1# and DateCheckOut > #date1# and = ' " & cmb_room & " ' " "Select * from...
1
8944
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; DateTime _start = Convert.ToDateTime(_sdate); string _ed = _edate.Split(' '); string _edate2 = _ed + " 23:59:59";
0
7693
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7917
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7665
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5501
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.