it is because you have 06/31/2009 is in-correct date, June have only 30 Days :)
Replace it with
DateAdd("m",1,'06/01/2009'
Main Topics
Browse All TopicsDear all,
Previously i can change dates between in where clause... but this month when i am trying to
change i am getting an error "your entry can't be converted to a valid date time value"
This is my query....
SELECT TOP 100 PERCENT dbo.Sales_09.*, dbo.IV00101.ITEMDESC, CASE WHEN serltnum IN ('epc101', 'epc102', 'epc103', 'ae0002')
THEN 'STRATEGIC_SPARES' WHEN serltnum IN ('epc001', 'epc002', 'epc003') THEN 'EPC_CONSUMABLES' WHEN serltnum IN ('ae0001', 'ae0003',
'ae0004', 'ae0005', 'ae0006') THEN 'AEOM_CONSUMABLES' WHEN serltnum IN ('IS0001', 'IS0002', 'IS0003', 'IS0004', 'IS0005', 'IS0006', 'IS0007',
'IS0008', 'IS0009', 'IS0010', 'IS0011', 'IS0012', 'IS0013', 'IS0014', 'IS0015') THEN 'INITIAL_SPARES' END AS itemtype,
dbo.Sales_09.SERLTQTY * dbo.Sales_09.UNITCOST AS total_itemsoldvalue, dbo.IV00101.UOMSCHDL
FROM dbo.Sales_09 INNER JOIN
dbo.IV00101 ON dbo.Sales_09.ITEMNMBR = dbo.IV00101.ITEMNMBR
WHERE (dbo.IV00101.ITEMTYPE <> 5) AND (dbo.Sales_09.daterecd BETWEEN '06/01/2009' AND '06/31/2009')
ORDER BY dbo.Sales_09.ITEMNMBR
why i am getting error this month only, i didn't change anything in settings....this settings i need to change everymonth first week. (according to current month).
Please solve my problem.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: elkhawajahPosted on 2009-07-05 at 00:43:10ID: 24779123
The Month June doesn't Have A DAY NUMBER 31.. Last day in this month is 30,
So you would write :
BETWEEN '06/01/2009' AND '06/30/2009'