I'm trying to bulk load an xml with parent child nodes.
I have setup an sql:relationship and I have also setup the two database
columns as Identity columns. However when I try to load the data, SQL is
telling me that the column can not be NULL ...
Any ideas please ?
Michael Tissington
http://www.oaklodge.com
http://www.sqlview.netHello Michael,
Thank you for using Microsoft MSDN newsgroup!
I understand you encountered the issue when importing xml with parent/child
nodes. To get a better idea of the exact issue, will you send the xml files
and script to create the tables in database to me so that I may reproduce
the issue on my side? You could send it to me at petery@.microsoft.com.
Also, you may want to refer to the following article for some know issue:
330582 PRB: "No Data Was Provided for Column" Error Message When You
Propagate Identity Column with SQLXMLBulkLoad
http://support.microsoft.com/defaul...kb;EN-US;330582
I look forward to your reply.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
Showing posts with label nodes. Show all posts
Showing posts with label nodes. Show all posts
Thursday, March 29, 2012
Tuesday, February 14, 2012
Building SQL Query to fill a treeview control with Year->Month->Day nodes
Hello,
I have load dates for each row in my database table. I'm trying to build a
query that will give me all of the unique years, then all of the unique
months for that year, then finally all of the unique days for that month.
I'm trying to load a treeview control with the results like so.
Year
|_
Month
|_
Day
Day
Etc.
Year
|_
Month
|_
Day
Etc.
If anyone has any ideas or experience on how to do this I would appreciate
it.
Thanks
You could simply write a query that does a join with a calendar table.
http://www.aspfaq.com/2519
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> Hello,
>
> I have load dates for each row in my database table. I'm trying to build
a
> query that will give me all of the unique years, then all of the unique
> months for that year, then finally all of the unique days for that month.
>
> I'm trying to load a treeview control with the results like so.
>
> Year
> |_
> Month
> |_
> Day
> Day
> Etc.
> Year
> |_
> Month
> |_
> Day
> Etc.
>
> If anyone has any ideas or experience on how to do this I would appreciate
> it.
>
> Thanks
>
|||Hmm, looks like it could help. Unfortunately, I only want my treeview to
show the dates that are actually in the database, where as this approach
seems to just show all dates between a range.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> You could simply write a query that does a join with a calendar table.
> http://www.aspfaq.com/2519
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
build[vbcol=seagreen]
> a
month.[vbcol=seagreen]
appreciate
>
|||Can you show your table structure (see http://www.aspfaq.com/5006)?
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> Hmm, looks like it could help. Unfortunately, I only want my treeview to
> show the dates that are actually in the database, where as this approach
> seems to just show all dates between a range.
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> build
unique
> month.
> appreciate
>
|||Well, it's nothing special. It's just a table with a Primary Key with a few
other columns and a LoadDT column that is of type datetime.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:u5DN4RMcEHA.2840@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> Can you show your table structure (see http://www.aspfaq.com/5006)?
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...
to
> unique
>
I have load dates for each row in my database table. I'm trying to build a
query that will give me all of the unique years, then all of the unique
months for that year, then finally all of the unique days for that month.
I'm trying to load a treeview control with the results like so.
Year
|_
Month
|_
Day
Day
Etc.
Year
|_
Month
|_
Day
Etc.
If anyone has any ideas or experience on how to do this I would appreciate
it.
Thanks
You could simply write a query that does a join with a calendar table.
http://www.aspfaq.com/2519
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> Hello,
>
> I have load dates for each row in my database table. I'm trying to build
a
> query that will give me all of the unique years, then all of the unique
> months for that year, then finally all of the unique days for that month.
>
> I'm trying to load a treeview control with the results like so.
>
> Year
> |_
> Month
> |_
> Day
> Day
> Etc.
> Year
> |_
> Month
> |_
> Day
> Etc.
>
> If anyone has any ideas or experience on how to do this I would appreciate
> it.
>
> Thanks
>
|||Hmm, looks like it could help. Unfortunately, I only want my treeview to
show the dates that are actually in the database, where as this approach
seems to just show all dates between a range.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> You could simply write a query that does a join with a calendar table.
> http://www.aspfaq.com/2519
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
build[vbcol=seagreen]
> a
month.[vbcol=seagreen]
appreciate
>
|||Can you show your table structure (see http://www.aspfaq.com/5006)?
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> Hmm, looks like it could help. Unfortunately, I only want my treeview to
> show the dates that are actually in the database, where as this approach
> seems to just show all dates between a range.
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> build
unique
> month.
> appreciate
>
|||Well, it's nothing special. It's just a table with a Primary Key with a few
other columns and a LoadDT column that is of type datetime.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:u5DN4RMcEHA.2840@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> Can you show your table structure (see http://www.aspfaq.com/5006)?
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...
to
> unique
>
Building SQL Query to fill a treeview control with Year->Month->Day nodes
Hello,
I have load dates for each row in my database table. I'm trying to build a
query that will give me all of the unique years, then all of the unique
months for that year, then finally all of the unique days for that month.
I'm trying to load a treeview control with the results like so.
Year
|_
Month
|_
Day
Day
Etc.
Year
|_
Month
|_
Day
Etc.
If anyone has any ideas or experience on how to do this I would appreciate
it.
ThanksYou could simply write a query that does a join with a calendar table.
http://www.aspfaq.com/2519
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> Hello,
>
> I have load dates for each row in my database table. I'm trying to build
a
> query that will give me all of the unique years, then all of the unique
> months for that year, then finally all of the unique days for that month.
>
> I'm trying to load a treeview control with the results like so.
>
> Year
> |_
> Month
> |_
> Day
> Day
> Etc.
> Year
> |_
> Month
> |_
> Day
> Etc.
>
> If anyone has any ideas or experience on how to do this I would appreciate
> it.
>
> Thanks
>|||Hmm, looks like it could help. Unfortunately, I only want my treeview to
show the dates that are actually in the database, where as this approach
seems to just show all dates between a range.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> You could simply write a query that does a join with a calendar table.
> http://www.aspfaq.com/2519
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
build[vbcol=seagreen]
> a
month.[vbcol=seagreen]
appreciate[vbcol=seagreen]
>|||Can you show your table structure (see http://www.aspfaq.com/5006)?
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...
> Hmm, looks like it could help. Unfortunately, I only want my treeview to
> show the dates that are actually in the database, where as this approach
> seems to just show all dates between a range.
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> build
unique[vbcol=seagreen]
> month.
> appreciate
>|||Well, it's nothing special. It's just a table with a Primary Key with a few
other columns and a LoadDT column that is of type datetime.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:u5DN4RMcEHA.2840@.TK2MSFTNGP11.phx.gbl...
> Can you show your table structure (see http://www.aspfaq.com/5006)?
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...
to[vbcol=seagreen]
> unique
>
I have load dates for each row in my database table. I'm trying to build a
query that will give me all of the unique years, then all of the unique
months for that year, then finally all of the unique days for that month.
I'm trying to load a treeview control with the results like so.
Year
|_
Month
|_
Day
Day
Etc.
Year
|_
Month
|_
Day
Etc.
If anyone has any ideas or experience on how to do this I would appreciate
it.
ThanksYou could simply write a query that does a join with a calendar table.
http://www.aspfaq.com/2519
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> Hello,
>
> I have load dates for each row in my database table. I'm trying to build
a
> query that will give me all of the unique years, then all of the unique
> months for that year, then finally all of the unique days for that month.
>
> I'm trying to load a treeview control with the results like so.
>
> Year
> |_
> Month
> |_
> Day
> Day
> Etc.
> Year
> |_
> Month
> |_
> Day
> Etc.
>
> If anyone has any ideas or experience on how to do this I would appreciate
> it.
>
> Thanks
>|||Hmm, looks like it could help. Unfortunately, I only want my treeview to
show the dates that are actually in the database, where as this approach
seems to just show all dates between a range.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> You could simply write a query that does a join with a calendar table.
> http://www.aspfaq.com/2519
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
build[vbcol=seagreen]
> a
month.[vbcol=seagreen]
appreciate[vbcol=seagreen]
>|||Can you show your table structure (see http://www.aspfaq.com/5006)?
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...
> Hmm, looks like it could help. Unfortunately, I only want my treeview to
> show the dates that are actually in the database, where as this approach
> seems to just show all dates between a range.
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> build
unique[vbcol=seagreen]
> month.
> appreciate
>|||Well, it's nothing special. It's just a table with a Primary Key with a few
other columns and a LoadDT column that is of type datetime.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:u5DN4RMcEHA.2840@.TK2MSFTNGP11.phx.gbl...
> Can you show your table structure (see http://www.aspfaq.com/5006)?
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...
to[vbcol=seagreen]
> unique
>
Building SQL Query to fill a treeview control with Year->Month->Day nodes
Hello,
I have load dates for each row in my database table. I'm trying to build a
query that will give me all of the unique years, then all of the unique
months for that year, then finally all of the unique days for that month.
I'm trying to load a treeview control with the results like so.
Year
|_
Month
|_
Day
Day
Etc.
Year
|_
Month
|_
Day
Etc.
If anyone has any ideas or experience on how to do this I would appreciate
it.
Thanks
You could simply write a query that does a join with a calendar table.
http://www.aspfaq.com/2519
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> Hello,
>
> I have load dates for each row in my database table. I'm trying to build
a
> query that will give me all of the unique years, then all of the unique
> months for that year, then finally all of the unique days for that month.
>
> I'm trying to load a treeview control with the results like so.
>
> Year
> |_
> Month
> |_
> Day
> Day
> Etc.
> Year
> |_
> Month
> |_
> Day
> Etc.
>
> If anyone has any ideas or experience on how to do this I would appreciate
> it.
>
> Thanks
>
|||Hmm, looks like it could help. Unfortunately, I only want my treeview to
show the dates that are actually in the database, where as this approach
seems to just show all dates between a range.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> You could simply write a query that does a join with a calendar table.
> http://www.aspfaq.com/2519
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
build[vbcol=seagreen]
> a
month.[vbcol=seagreen]
appreciate
>
|||Can you show your table structure (see http://www.aspfaq.com/5006)?
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> Hmm, looks like it could help. Unfortunately, I only want my treeview to
> show the dates that are actually in the database, where as this approach
> seems to just show all dates between a range.
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> build
unique
> month.
> appreciate
>
|||Well, it's nothing special. It's just a table with a Primary Key with a few
other columns and a LoadDT column that is of type datetime.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:u5DN4RMcEHA.2840@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> Can you show your table structure (see http://www.aspfaq.com/5006)?
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...
to
> unique
>
I have load dates for each row in my database table. I'm trying to build a
query that will give me all of the unique years, then all of the unique
months for that year, then finally all of the unique days for that month.
I'm trying to load a treeview control with the results like so.
Year
|_
Month
|_
Day
Day
Etc.
Year
|_
Month
|_
Day
Etc.
If anyone has any ideas or experience on how to do this I would appreciate
it.
Thanks
You could simply write a query that does a join with a calendar table.
http://www.aspfaq.com/2519
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> Hello,
>
> I have load dates for each row in my database table. I'm trying to build
a
> query that will give me all of the unique years, then all of the unique
> months for that year, then finally all of the unique days for that month.
>
> I'm trying to load a treeview control with the results like so.
>
> Year
> |_
> Month
> |_
> Day
> Day
> Etc.
> Year
> |_
> Month
> |_
> Day
> Etc.
>
> If anyone has any ideas or experience on how to do this I would appreciate
> it.
>
> Thanks
>
|||Hmm, looks like it could help. Unfortunately, I only want my treeview to
show the dates that are actually in the database, where as this approach
seems to just show all dates between a range.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> You could simply write a query that does a join with a calendar table.
> http://www.aspfaq.com/2519
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
build[vbcol=seagreen]
> a
month.[vbcol=seagreen]
appreciate
>
|||Can you show your table structure (see http://www.aspfaq.com/5006)?
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> Hmm, looks like it could help. Unfortunately, I only want my treeview to
> show the dates that are actually in the database, where as this approach
> seems to just show all dates between a range.
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> build
unique
> month.
> appreciate
>
|||Well, it's nothing special. It's just a table with a Primary Key with a few
other columns and a LoadDT column that is of type datetime.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:u5DN4RMcEHA.2840@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> Can you show your table structure (see http://www.aspfaq.com/5006)?
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...
to
> unique
>
Building SQL Query to fill a treeview control with Year->Month->Day nodes
Hello,
I have load dates for each row in my database table. I'm trying to build a
query that will give me all of the unique years, then all of the unique
months for that year, then finally all of the unique days for that month.
I'm trying to load a treeview control with the results like so.
Year
|_
Month
|_
Day
Day
Etc.
Year
|_
Month
|_
Day
Etc.
If anyone has any ideas or experience on how to do this I would appreciate
it.
Thanks
You could simply write a query that does a join with a calendar table.
http://www.aspfaq.com/2519
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> Hello,
>
> I have load dates for each row in my database table. I'm trying to build
a
> query that will give me all of the unique years, then all of the unique
> months for that year, then finally all of the unique days for that month.
>
> I'm trying to load a treeview control with the results like so.
>
> Year
> |_
> Month
> |_
> Day
> Day
> Etc.
> Year
> |_
> Month
> |_
> Day
> Etc.
>
> If anyone has any ideas or experience on how to do this I would appreciate
> it.
>
> Thanks
>
|||Hmm, looks like it could help. Unfortunately, I only want my treeview to
show the dates that are actually in the database, where as this approach
seems to just show all dates between a range.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> You could simply write a query that does a join with a calendar table.
> http://www.aspfaq.com/2519
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
build[vbcol=seagreen]
> a
month.[vbcol=seagreen]
appreciate
>
|||Can you show your table structure (see http://www.aspfaq.com/5006)?
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> Hmm, looks like it could help. Unfortunately, I only want my treeview to
> show the dates that are actually in the database, where as this approach
> seems to just show all dates between a range.
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> build
unique
> month.
> appreciate
>
|||Well, it's nothing special. It's just a table with a Primary Key with a few
other columns and a LoadDT column that is of type datetime.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:u5DN4RMcEHA.2840@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> Can you show your table structure (see http://www.aspfaq.com/5006)?
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...
to
> unique
>
I have load dates for each row in my database table. I'm trying to build a
query that will give me all of the unique years, then all of the unique
months for that year, then finally all of the unique days for that month.
I'm trying to load a treeview control with the results like so.
Year
|_
Month
|_
Day
Day
Etc.
Year
|_
Month
|_
Day
Etc.
If anyone has any ideas or experience on how to do this I would appreciate
it.
Thanks
You could simply write a query that does a join with a calendar table.
http://www.aspfaq.com/2519
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> Hello,
>
> I have load dates for each row in my database table. I'm trying to build
a
> query that will give me all of the unique years, then all of the unique
> months for that year, then finally all of the unique days for that month.
>
> I'm trying to load a treeview control with the results like so.
>
> Year
> |_
> Month
> |_
> Day
> Day
> Etc.
> Year
> |_
> Month
> |_
> Day
> Etc.
>
> If anyone has any ideas or experience on how to do this I would appreciate
> it.
>
> Thanks
>
|||Hmm, looks like it could help. Unfortunately, I only want my treeview to
show the dates that are actually in the database, where as this approach
seems to just show all dates between a range.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> You could simply write a query that does a join with a calendar table.
> http://www.aspfaq.com/2519
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
build[vbcol=seagreen]
> a
month.[vbcol=seagreen]
appreciate
>
|||Can you show your table structure (see http://www.aspfaq.com/5006)?
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> Hmm, looks like it could help. Unfortunately, I only want my treeview to
> show the dates that are actually in the database, where as this approach
> seems to just show all dates between a range.
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> build
unique
> month.
> appreciate
>
|||Well, it's nothing special. It's just a table with a Primary Key with a few
other columns and a LoadDT column that is of type datetime.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:u5DN4RMcEHA.2840@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> Can you show your table structure (see http://www.aspfaq.com/5006)?
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...
to
> unique
>
Building SQL Query to fill a treeview control with Year->Month->Day nodes
Hello,
I have load dates for each row in my database table. I'm trying to build a
query that will give me all of the unique years, then all of the unique
months for that year, then finally all of the unique days for that month.
I'm trying to load a treeview control with the results like so.
Year
|_
Month
|_
Day
Day
Etc.
Year
|_
Month
|_
Day
Etc.
If anyone has any ideas or experience on how to do this I would appreciate
it.
ThanksYou could simply write a query that does a join with a calendar table.
http://www.aspfaq.com/2519
--
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> Hello,
>
> I have load dates for each row in my database table. I'm trying to build
a
> query that will give me all of the unique years, then all of the unique
> months for that year, then finally all of the unique days for that month.
>
> I'm trying to load a treeview control with the results like so.
>
> Year
> |_
> Month
> |_
> Day
> Day
> Etc.
> Year
> |_
> Month
> |_
> Day
> Etc.
>
> If anyone has any ideas or experience on how to do this I would appreciate
> it.
>
> Thanks
>|||Hmm, looks like it could help. Unfortunately, I only want my treeview to
show the dates that are actually in the database, where as this approach
seems to just show all dates between a range.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> You could simply write a query that does a join with a calendar table.
> http://www.aspfaq.com/2519
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> > Hello,
> >
> >
> >
> > I have load dates for each row in my database table. I'm trying to
build
> a
> > query that will give me all of the unique years, then all of the unique
> > months for that year, then finally all of the unique days for that
month.
> >
> >
> >
> > I'm trying to load a treeview control with the results like so.
> >
> >
> >
> > Year
> >
> > |_
> >
> > Month
> >
> > |_
> >
> > Day
> >
> > Day
> >
> > Etc.
> >
> > Year
> >
> > |_
> >
> > Month
> >
> > |_
> >
> > Day
> >
> > Etc.
> >
> >
> >
> > If anyone has any ideas or experience on how to do this I would
appreciate
> > it.
> >
> >
> >
> > Thanks
> >
> >
>|||Can you show your table structure (see http://www.aspfaq.com/5006)?
--
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...
> Hmm, looks like it could help. Unfortunately, I only want my treeview to
> show the dates that are actually in the database, where as this approach
> seems to just show all dates between a range.
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> > You could simply write a query that does a join with a calendar table.
> > http://www.aspfaq.com/2519
> >
> > --
> > http://www.aspfaq.com/
> > (Reverse address to reply.)
> >
> >
> >
> >
> > "MJB" <mb2@.email.com> wrote in message
> > news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> > > Hello,
> > >
> > >
> > >
> > > I have load dates for each row in my database table. I'm trying to
> build
> > a
> > > query that will give me all of the unique years, then all of the
unique
> > > months for that year, then finally all of the unique days for that
> month.
> > >
> > >
> > >
> > > I'm trying to load a treeview control with the results like so.
> > >
> > >
> > >
> > > Year
> > >
> > > |_
> > >
> > > Month
> > >
> > > |_
> > >
> > > Day
> > >
> > > Day
> > >
> > > Etc.
> > >
> > > Year
> > >
> > > |_
> > >
> > > Month
> > >
> > > |_
> > >
> > > Day
> > >
> > > Etc.
> > >
> > >
> > >
> > > If anyone has any ideas or experience on how to do this I would
> appreciate
> > > it.
> > >
> > >
> > >
> > > Thanks
> > >
> > >
> >
> >
>|||Well, it's nothing special. It's just a table with a Primary Key with a few
other columns and a LoadDT column that is of type datetime.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:u5DN4RMcEHA.2840@.TK2MSFTNGP11.phx.gbl...
> Can you show your table structure (see http://www.aspfaq.com/5006)?
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...
> > Hmm, looks like it could help. Unfortunately, I only want my treeview
to
> > show the dates that are actually in the database, where as this approach
> > seems to just show all dates between a range.
> >
> >
> > "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> > news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> > > You could simply write a query that does a join with a calendar table.
> > > http://www.aspfaq.com/2519
> > >
> > > --
> > > http://www.aspfaq.com/
> > > (Reverse address to reply.)
> > >
> > >
> > >
> > >
> > > "MJB" <mb2@.email.com> wrote in message
> > > news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> > > > Hello,
> > > >
> > > >
> > > >
> > > > I have load dates for each row in my database table. I'm trying to
> > build
> > > a
> > > > query that will give me all of the unique years, then all of the
> unique
> > > > months for that year, then finally all of the unique days for that
> > month.
> > > >
> > > >
> > > >
> > > > I'm trying to load a treeview control with the results like so.
> > > >
> > > >
> > > >
> > > > Year
> > > >
> > > > |_
> > > >
> > > > Month
> > > >
> > > > |_
> > > >
> > > > Day
> > > >
> > > > Day
> > > >
> > > > Etc.
> > > >
> > > > Year
> > > >
> > > > |_
> > > >
> > > > Month
> > > >
> > > > |_
> > > >
> > > > Day
> > > >
> > > > Etc.
> > > >
> > > >
> > > >
> > > > If anyone has any ideas or experience on how to do this I would
> > appreciate
> > > > it.
> > > >
> > > >
> > > >
> > > > Thanks
> > > >
> > > >
> > >
> > >
> >
> >
>
I have load dates for each row in my database table. I'm trying to build a
query that will give me all of the unique years, then all of the unique
months for that year, then finally all of the unique days for that month.
I'm trying to load a treeview control with the results like so.
Year
|_
Month
|_
Day
Day
Etc.
Year
|_
Month
|_
Day
Etc.
If anyone has any ideas or experience on how to do this I would appreciate
it.
ThanksYou could simply write a query that does a join with a calendar table.
http://www.aspfaq.com/2519
--
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> Hello,
>
> I have load dates for each row in my database table. I'm trying to build
a
> query that will give me all of the unique years, then all of the unique
> months for that year, then finally all of the unique days for that month.
>
> I'm trying to load a treeview control with the results like so.
>
> Year
> |_
> Month
> |_
> Day
> Day
> Etc.
> Year
> |_
> Month
> |_
> Day
> Etc.
>
> If anyone has any ideas or experience on how to do this I would appreciate
> it.
>
> Thanks
>|||Hmm, looks like it could help. Unfortunately, I only want my treeview to
show the dates that are actually in the database, where as this approach
seems to just show all dates between a range.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> You could simply write a query that does a join with a calendar table.
> http://www.aspfaq.com/2519
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> > Hello,
> >
> >
> >
> > I have load dates for each row in my database table. I'm trying to
build
> a
> > query that will give me all of the unique years, then all of the unique
> > months for that year, then finally all of the unique days for that
month.
> >
> >
> >
> > I'm trying to load a treeview control with the results like so.
> >
> >
> >
> > Year
> >
> > |_
> >
> > Month
> >
> > |_
> >
> > Day
> >
> > Day
> >
> > Etc.
> >
> > Year
> >
> > |_
> >
> > Month
> >
> > |_
> >
> > Day
> >
> > Etc.
> >
> >
> >
> > If anyone has any ideas or experience on how to do this I would
appreciate
> > it.
> >
> >
> >
> > Thanks
> >
> >
>|||Can you show your table structure (see http://www.aspfaq.com/5006)?
--
http://www.aspfaq.com/
(Reverse address to reply.)
"MJB" <mb2@.email.com> wrote in message
news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...
> Hmm, looks like it could help. Unfortunately, I only want my treeview to
> show the dates that are actually in the database, where as this approach
> seems to just show all dates between a range.
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> > You could simply write a query that does a join with a calendar table.
> > http://www.aspfaq.com/2519
> >
> > --
> > http://www.aspfaq.com/
> > (Reverse address to reply.)
> >
> >
> >
> >
> > "MJB" <mb2@.email.com> wrote in message
> > news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> > > Hello,
> > >
> > >
> > >
> > > I have load dates for each row in my database table. I'm trying to
> build
> > a
> > > query that will give me all of the unique years, then all of the
unique
> > > months for that year, then finally all of the unique days for that
> month.
> > >
> > >
> > >
> > > I'm trying to load a treeview control with the results like so.
> > >
> > >
> > >
> > > Year
> > >
> > > |_
> > >
> > > Month
> > >
> > > |_
> > >
> > > Day
> > >
> > > Day
> > >
> > > Etc.
> > >
> > > Year
> > >
> > > |_
> > >
> > > Month
> > >
> > > |_
> > >
> > > Day
> > >
> > > Etc.
> > >
> > >
> > >
> > > If anyone has any ideas or experience on how to do this I would
> appreciate
> > > it.
> > >
> > >
> > >
> > > Thanks
> > >
> > >
> >
> >
>|||Well, it's nothing special. It's just a table with a Primary Key with a few
other columns and a LoadDT column that is of type datetime.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:u5DN4RMcEHA.2840@.TK2MSFTNGP11.phx.gbl...
> Can you show your table structure (see http://www.aspfaq.com/5006)?
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "MJB" <mb2@.email.com> wrote in message
> news:#jGPjPMcEHA.3476@.tk2msftngp13.phx.gbl...
> > Hmm, looks like it could help. Unfortunately, I only want my treeview
to
> > show the dates that are actually in the database, where as this approach
> > seems to just show all dates between a range.
> >
> >
> > "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> > news:eSYmS0LcEHA.3480@.TK2MSFTNGP11.phx.gbl...
> > > You could simply write a query that does a join with a calendar table.
> > > http://www.aspfaq.com/2519
> > >
> > > --
> > > http://www.aspfaq.com/
> > > (Reverse address to reply.)
> > >
> > >
> > >
> > >
> > > "MJB" <mb2@.email.com> wrote in message
> > > news:euAyUyLcEHA.2476@.TK2MSFTNGP09.phx.gbl...
> > > > Hello,
> > > >
> > > >
> > > >
> > > > I have load dates for each row in my database table. I'm trying to
> > build
> > > a
> > > > query that will give me all of the unique years, then all of the
> unique
> > > > months for that year, then finally all of the unique days for that
> > month.
> > > >
> > > >
> > > >
> > > > I'm trying to load a treeview control with the results like so.
> > > >
> > > >
> > > >
> > > > Year
> > > >
> > > > |_
> > > >
> > > > Month
> > > >
> > > > |_
> > > >
> > > > Day
> > > >
> > > > Day
> > > >
> > > > Etc.
> > > >
> > > > Year
> > > >
> > > > |_
> > > >
> > > > Month
> > > >
> > > > |_
> > > >
> > > > Day
> > > >
> > > > Etc.
> > > >
> > > >
> > > >
> > > > If anyone has any ideas or experience on how to do this I would
> > appreciate
> > > > it.
> > > >
> > > >
> > > >
> > > > Thanks
> > > >
> > > >
> > >
> > >
> >
> >
>
Subscribe to:
Posts (Atom)