Date function from database


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Date function from database

  1. #1
    Join Date
    Mar 2005
    Posts
    2

    Date function from database

    Hi guys

    I'm writing an item subscription program for my class. the Acess database records include StartDate and EndDate for subscription. I'd like to have a function to go through the record and check for persons whose subscription expires next month if today is on the 28th of this month provided today is not weekend. The function shoul list the firstname of the affected person on a form.

    I also want a function to sniff thru record and add values from last monday till today id today is friday . The function should place the totalvalue in the field named week with the week number

    Thesame should actually be done for the month by adding the totals of every in that month together and place it in a field named month with monthname

    i'm really new to vb..... Can someone help me on this....

    its for my college project... doing this really means alot to my career

    Thank you for all ur time

  2. #2
    Join Date
    Aug 2004
    Location
    Orange, California
    Posts
    1,263

    Try the DatePart function

    The DatePart function returns any part of the date that you want. The day, or the month, or the year, or the week ect..
    Also there is a DateDiff Function for date calculations.

    Some Available Date functions (use help for more info):
    DatePart(interval, date[,firstdayofweek[, firstweekofyear]])
    DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]])
    DateAdd(interval, number, date)
    DateSerial(year, month, day)
    DateValue(date)
    Day(date)
    Month(date)
    Year(date)
    Now()
    Weekday(date, [firstdayofweek])
    WeekdayName(weekday, abbreviate, firstdayofweek)
    CDate(expression)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center