Click here to Skip to main content
15,908,437 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionMultiple datasource on rdlc in asp.net Pin
C#Coudou23-Aug-11 20:13
C#Coudou23-Aug-11 20:13 
Questiongroup by years Pin
sorin_zan23-Aug-11 7:58
sorin_zan23-Aug-11 7:58 
AnswerRe: group by years Pin
Dave Kreskowiak23-Aug-11 10:48
mveDave Kreskowiak23-Aug-11 10:48 
AnswerRe: group by years Pin
Dalek Dave23-Aug-11 11:21
professionalDalek Dave23-Aug-11 11:21 
AnswerRe: group by years Pin
Shahan Ayyub23-Aug-11 14:09
Shahan Ayyub23-Aug-11 14:09 
AnswerRe: group by years Pin
Luc Pattyn23-Aug-11 16:54
sitebuilderLuc Pattyn23-Aug-11 16:54 
GeneralRe: group by years Pin
sorin_zan23-Aug-11 20:11
sorin_zan23-Aug-11 20:11 
AnswerRe: group by years [modified] Pin
Luc Pattyn23-Aug-11 17:00
sitebuilderLuc Pattyn23-Aug-11 17:00 
Hi,

1.
you're in the wrong forum, this is a database question, not a VB one. So the SQL or Database forums are more appropriate.

2.
this works fine on SQL Server:
SELECT COUNT(1), year(payment_date) as year FROM payments  GROUP BY year(payment_date)


However it fails on Access, and so does this:
SELECT COUNT(1), datepart("yyyy", payment_date) as year FROM payments GROUP BY datepart("yyyy", payment_date)


However this does it:
SELECT COUNT(1), datepart("yyyy", payment_date) as yr FROM payments  GROUP BY datepart("yyyy", payment_date)

so the only problem was SQL Server did and Access didn't accept "year" as an alias (it also is a function name).

[ADDED]: one can use square brackets when there is a risk of clashing with reserved keywords, like so:
SELECT COUNT(1) as [count], datepart("yyyy", payment_date) as [year] FROM payments GROUP BY datepart("yyyy", payment_date)

[/ADDED]


Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
modified on Wednesday, August 24, 2011 12:09 AM

GeneralRe: group by years Pin
sorin_zan23-Aug-11 19:38
sorin_zan23-Aug-11 19:38 
GeneralRe: group by years Pin
Shahan Ayyub24-Aug-11 5:59
Shahan Ayyub24-Aug-11 5:59 
GeneralRe: group by years Pin
sorin_zan24-Aug-11 7:17
sorin_zan24-Aug-11 7:17 
QuestionRe: group by years Pin
Shahan Ayyub24-Aug-11 21:52
Shahan Ayyub24-Aug-11 21:52 
AnswerRe: group by years Pin
sorin_zan25-Aug-11 0:26
sorin_zan25-Aug-11 0:26 
GeneralRe: group by years Pin
sorin_zan23-Aug-11 20:09
sorin_zan23-Aug-11 20:09 
GeneralRe: group by years Pin
sorin_zan23-Aug-11 21:10
sorin_zan23-Aug-11 21:10 
Questionplease help me how to fix this program this is a calculator in vb6.0 Pin
VBBeginerGSM22-Aug-11 3:26
VBBeginerGSM22-Aug-11 3:26 
AnswerRe: please help me how to fix this program this is a calculator in vb6.0 Pin
Simon_Whale22-Aug-11 3:27
Simon_Whale22-Aug-11 3:27 
AnswerRe: please help me how to fix this program this is a calculator in vb6.0 [modified] Pin
VBBeginerGSM22-Aug-11 3:42
VBBeginerGSM22-Aug-11 3:42 
GeneralRe: please help me how to fix this program this is a calculator in vb6.0 Pin
Smithers-Jones22-Aug-11 6:46
Smithers-Jones22-Aug-11 6:46 
GeneralRe: please help me how to fix this program this is a calculator in vb6.0 Pin
Аslam Iqbal23-Aug-11 8:09
professionalАslam Iqbal23-Aug-11 8:09 
GeneralRe: please help me how to fix this program this is a calculator in vb6.0 Pin
VBBeginerGSM23-Aug-11 22:09
VBBeginerGSM23-Aug-11 22:09 
GeneralRe: please help me how to fix this program this is a calculator in vb6.0 Pin
Аslam Iqbal23-Aug-11 23:34
professionalАslam Iqbal23-Aug-11 23:34 
AnswerRe: please help me how to fix this program this is a calculator in vb6.0 Pin
riced22-Aug-11 4:29
riced22-Aug-11 4:29 
GeneralRe: please help me how to fix this program this is a calculator in vb6.0 Pin
VBBeginerGSM22-Aug-11 4:37
VBBeginerGSM22-Aug-11 4:37 
GeneralRe: please help me how to fix this program this is a calculator in vb6.0 Pin
Simon_Whale22-Aug-11 4:42
Simon_Whale22-Aug-11 4:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.