Hello Everyone.
I have a quick question about comparing dates. For some reason I cannot figure this out and I know it should be real easy. Here is the situation that I need help on. I have a database in access and I need to compare the 'date' column with today's date and see if it's someones birthday. The 'date' column format in access is 12/15/2004. So what I need to do in VB.NET is compare the 12/15/2004 to someone that could have a birthday on 12/15/1975 in the 'date' column. I know I need to compare the 12/15 but how do I do that? Any help will do. Here is the code I have so far. Thank you in advance.
Manguilla
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim connString As String
Dim dbConn As System.Data.IDbConnection
Dim queryDate As String
Dim currDate As String
Dim resultEMAIL As String
Dim resultBDAY As String
connString = "Provider = Microsoft.Jet.Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=C:\temptest\Birthdays.mdb"
dbConn = New System.Data.OleDb.OleDbConnection(connString)
queryDate = "SELECT date from birthday"
currDate = Now()
'resultBDAY =
resultEMAIL = "SELECT email from birthday where date = "
objOutlook = CreateObject("Outlook.Application")
objOutlookMsg = objOutlook.CreateItem(Outlook.OlItemType.olMailItem)
With objOutlookMsg
'.To = resultBDAY
.To = "chadenes@hotmail.com"
.Subject = "Happy Birthday"
.HTMLBody = "<html><head></head><body><p>Test Email</p></body></html>"
.Send()
End With
objOutlook = Nothing
MsgBox("Email was sent successfully")
End Sub
End Class
I have a quick question about comparing dates. For some reason I cannot figure this out and I know it should be real easy. Here is the situation that I need help on. I have a database in access and I need to compare the 'date' column with today's date and see if it's someones birthday. The 'date' column format in access is 12/15/2004. So what I need to do in VB.NET is compare the 12/15/2004 to someone that could have a birthday on 12/15/1975 in the 'date' column. I know I need to compare the 12/15 but how do I do that? Any help will do. Here is the code I have so far. Thank you in advance.
Manguilla
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim connString As String
Dim dbConn As System.Data.IDbConnection
Dim queryDate As String
Dim currDate As String
Dim resultEMAIL As String
Dim resultBDAY As String
connString = "Provider = Microsoft.Jet.Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=C:\temptest\Birthdays.mdb"
dbConn = New System.Data.OleDb.OleDbConnection(connString)
queryDate = "SELECT date from birthday"
currDate = Now()
'resultBDAY =
resultEMAIL = "SELECT email from birthday where date = "
objOutlook = CreateObject("Outlook.Application")
objOutlookMsg = objOutlook.CreateItem(Outlook.OlItemType.olMailItem)
With objOutlookMsg
'.To = resultBDAY
.To = "chadenes@hotmail.com"
.Subject = "Happy Birthday"
.HTMLBody = "<html><head></head><body><p>Test Email</p></body></html>"
.Send()
End With
objOutlook = Nothing
MsgBox("Email was sent successfully")
End Sub
End Class