Question Date....?

Jcode

Member
Joined
Jun 5, 2008
Messages
10
Programming Experience
Beginner
I have a database with when memberhsips expire.How would i make the members whose information that expires within a month of the date in the databse show on a table

For example the program would list the people whoose membershipe xpires within the next month in a datagrid
 
Last edited by a moderator:
u want to inform memebers whose merbership date expires in a month from current date.
write a code to check the merbership expiry date with current date. if the difference between 2dates is 30 or less than 30 , write a query for selecting that records & display/list
 
u want to inform memebers whose merbership date expires in a month from current date.
write a code to check the merbership expiry date with current date. if the difference between 2dates is 30 or less than 30 , write a query for selecting that records & display/list

Im a bit confuse don how that would work my dates are in the format of 01/01/2008
 
using any of the functions find the difference between 2 dates ie todays date & the expiry date
if the date difference is <=30(lessthan or euqal) than display that member detaiils

query :"select * from table where membership expiry date-cureentdate<=30"

today is 18/07/2008(dd/mm/yyyy)format
if membership expiry date is 17/07/2008 u shld get it in list
 
i'd use a query:

VB.NET:
SELECT
  *
FROM
  memberships
WHERE
  expiry_date between SYSDATE and SYSDATE+30

that's oracle syntax, btw because you8 didnt say what database youre using; you'll now have to work out how to apply it to your database. in oracle, SYSDATE is current time on the server, a bit like Now() in VB
 
i'd use a query:

VB.NET:
SELECT
  *
FROM
  memberships
WHERE
  expiry_date between SYSDATE and SYSDATE+30

that's oracle syntax, btw because you8 didnt say what database youre using; you'll now have to work out how to apply it to your database. in oracle, SYSDATE is current time on the server, a bit like Now() in VB

Im using an Access database
 
In access how would you get today's date? How would you get Todays date minus 30 days?

There's all kinds of functions for queries built into Access for this kind of stuff.

Also since this is being ran from .Net, you could put the query text into the select command of your data adapter and simply insert the Date1 and Date2 values using .Net code too

I left my example open like that for this reason, there's two places (two different ways) to put the two dates in, it's a matter of you figuring out which one to go with and after that you should know how to look up the information through msdn too.
 
Please feel free to use google at any time.. You are, after all, only seeking to know what the function is in Access that returns the current date-time, yes?

i.e. Show some effort that youre prepared to help yourself and others will be far more inclined to help you :)
(the answer was actually in this thread, if you'd read it)
 
Back
Top