Kim Neesgaard
asked on
Error by Day(Now) in a Windows application
In a web application I can use Year(Now), Month(Now), and Day(Now) just as I would expect.
In a Windows application I can use Year(Now) and Month(Now) but NOT Day(Now) and this is certainly not what I would expect. When I use it, I get the error:
Error 1 'Day' is a type and cannot be used as an expression. C:\1. Applications NZ-QM\Windows\SAP Recurring Tool Aid\SAP Recurring Tool Aid\Form1.vb 43 16 SAP Recurring Tool Aid
Can you tell me:
1/ Why can I not use Day(Now)?
2/ How can I then find the day number in a month?
In a Windows application I can use Year(Now) and Month(Now) but NOT Day(Now) and this is certainly not what I would expect. When I use it, I get the error:
Error 1 'Day' is a type and cannot be used as an expression. C:\1. Applications NZ-QM\Windows\SAP Recurring Tool Aid\SAP Recurring Tool Aid\Form1.vb 43 16 SAP Recurring Tool Aid
Can you tell me:
1/ Why can I not use Day(Now)?
2/ How can I then find the day number in a month?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
for your second question, you can use DaysInMonth as shown in http://msdn.microsoft.com/en-us/library/system.datetime.daysinmonth.aspx
ASKER
1/ First suggestion works fine!
2/ Second suggestion should be Date.Today.Day.
2/ Second suggestion should be Date.Today.Day.
You can request attention and ask for the points to be reassigned, or for the question to be open and then select multiple answers.
ASKER
Is there a waiting time for the question to be opened?
You have to wait till a moderator sees it, but you'll be notified when it is.
ASKER
Thank you!
ASKER
Split is now completed!
ASKER