Link to home
Start Free TrialLog in
Avatar of Kim Neesgaard
Kim NeesgaardFlag for Denmark

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?
ASKER CERTIFIED SOLUTION
Avatar of Cluskitt
Cluskitt
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kim Neesgaard

ASKER

I tried to split points but did not succeed - sorry for this.
for your second question, you can use DaysInMonth as shown in http://msdn.microsoft.com/en-us/library/system.datetime.daysinmonth.aspx
1/ First suggestion works fine!

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.
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.
Thank you!
Split is now completed!