Results 1 to 2 of 2

Thread: How to compare two Date values in two different columns of a table

  1. #1
    Ehtesham SIddiqui Guest

    How to compare two Date values in two different columns of a table

    Hi,

    My application is in VS2008 coded in vb.net.I have a table with three columns

    FromDate,Todate and Schedule.FromDate and ToDate will have date values whereas Schedule will have a any of these values(weekly,Monthly,Yearly)

    In my Form i have given some provision to the user to check the records.My requirement is The currentdate that is Today's date should be compared with the values of Fromdate and ToDate.First it should be check whether Schedule value is Weekly or Monthly or Yearly.If it is weekly than it should check the record in between fromDate to ToDate with a increment of one week.That means it should first check the first value of fromDate than add 7 days to the value and then again check from fromDate and this should continue till it reaches Todate.

    Im trying something like this but its not giving me good logic.
    Code:
     If Schedule = "Weekly" Then
     While Today >= FromDate And Today<= ToDate
     If Today = fromDate Then
      My application Code here
      End If
      fromDate.AddDays(7)
      End While
      End If
    I dont think its making any sense.

    Please Guide at the earliest.

  2. #2
    Join Date
    Mar 2010
    Posts
    145

    Re: How to compare two Date values in two different columns of a table

    I am really sorry is this solution does not helps you out much. But I had faced a similar kind of issue before. I thought putting the same here might be somewhat helpful. I tried to compare two different values of a table by using Unmatched query wizard. The wizard allows you to compare the tables and find those values which are not matching, anyhow a bit more helpful to me. So you can just for an testing way try this out.

Similar Threads

  1. How to compare text string of two different columns in Excel
    By Chini mao in forum Windows Software
    Replies: 3
    Last Post: 06-01-2012, 04:50 PM
  2. Replies: 5
    Last Post: 27-08-2011, 10:53 AM
  3. Compare values of my 2 servers with my code parameters in Perl
    By GurpreetC in forum Software Development
    Replies: 5
    Last Post: 11-02-2010, 08:35 AM
  4. How to add or delete columns of table in SQL?
    By Truster in forum Software Development
    Replies: 5
    Last Post: 11-01-2010, 12:09 PM
  5. How to compare two columns from different worksheet
    By Ameya in forum Windows Software
    Replies: 3
    Last Post: 27-04-2009, 11:34 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,675,518.79949 seconds with 17 queries