3 Replies - 2134 Views - Last Post: 19 March 2010 - 06:57 AM Rate Topic: -----

#1 adkem  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 19-March 10

How to show the date over due using VB,net

Posted 19 March 2010 - 01:40 AM

hello, i want to ask how to show the status by compare the current date with the data that in the database by using the VB.net and i'm using the SQL server for the database.. such as


if date in database < current date
..Status = OK

if date in database > current date
..status = Over due

please give me some guideline to resolve this problem..
Is This A Good Question/Topic? 0
  • +

Replies To: How to show the date over due using VB,net

#2 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: How to show the date over due using VB,net

Posted 19 March 2010 - 04:28 AM

Well you didn't supply any code so I'm assuming you can pull the date from the database.

So the only information I can give you is that you can use Date.Now for the current date.
So
If cDate(date in database) < date.now then
 ..Status = OK
End If

Was This Post Helpful? 0
  • +
  • -

#3 adkem  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 19-March 10

Re: How to show the date over due using VB,net

Posted 19 March 2010 - 06:27 AM

I am using the binding source to connect the data with the form. How can i generate it for different user? Such as i have a several data from admin;

example output:

Student Name : David
Due date of borrowed book : 3/30/2010
Status : OK

Student Name : Cristina
Due date of borrowed book : 1/1/2010
Status : Date Over due.Please return the book.
:
:
:
...

my problem is the date that i used in data binding is type of DateTimePicker, can it compare to Data.Now? and i also want the status will be automatic changes the status when the date over due.
Was This Post Helpful? 0
  • +
  • -

#4 adkem  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 19-March 10

Re: How to show the date over due using VB,net

Posted 19 March 2010 - 06:57 AM

what did you mean by "(date in database)"..its like

If CDate(TarikhTamatCukaiJalan in Sistem_Pengesanan_Tamat_Tempoh_Cukai_JalanP_RFID.xsd) < Date.Now Then
TxtStatus.Text = "OK"
End If

but it has an error..can u help me?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1