Hi there,
I know some about outer joins, and can see how they work when given a small example. But to actually use them (and think of them on my own is rather difficult). I've mostly had to use basic SQL when making websites, and smaller web based programs. However, now that I am getting into...
I am getting an error that says "Column 'zip' in the field list is ambiguous.
Also, How can you SELECT zip, MONTH (lastvisit), COUNT(*) FROM ("SELECT DISTINCT zip FROM production") when this sub query only returns a list of zip codes and no lastvisit information.
Thanks for trying. I have...
Hi guys,
Got a little problem here. I can't for the life of me, figure out how to do this.
pid | firstlast | lastvisit | zip
---------------------------------------
435 | 2001-01-17 | 2012-01-21 | 46530
567 | 2001-01-18 | 2012-01-21 | 46530
532 | 2001-01-19 | 2012-01-22 | 46535
536 |...
Awesome, thank you very much for the quick reply. I can finally get back to work!!!
I did have to fix one thing at the bottom because I got an invalid column name at the very bottom "on visits.lib_id=lib_info.lib_id" should have been "on visits.lib_id=lib_info.lib_code". But I figured that part...
Greeting from Indiana!
This is what I am working with, I have two tables. One is an accounts table, one is a visitors table where records are added as a person visits.
I believe I need to use a LEFT JOIN, but I am not sure how to do it. I have tried creating one and I get errors that I don't...
Hello,
I've been developing in JSP using the Struts Framework for about 3 months now. I use Netbeans IDE 7, and it's been fun! However, I am looking to start developing some Java Desktop applications. Netbeans tells me that the "Swing Application Framework" is basically outdated and no longer...
Never mind guys! I figured it out!
Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR, 2011);
cal.set(Calendar.WEEK_OF_YEAR, 1);
cal.set(Calendar.DAY_OF_WEEK, 2);
cal.set(Calendar.HOUR, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0)...
I jumped into Java using the "Head First Java" book from O'reilly. It was very nice for beginners. They teach you the basics using non-gui java programming. I found it difficult to use Eclipse because not only are you overwhelmed with a new language, but a new program as well.
Now I use...
Hello fellow forum members!!!
I am using Calendar.WEEK_OF_YEAR to return to me an integer of 1-53, my week is set to start on Monday's. So the first week of 2011, was December 27th, 2010 - January 2nd, 2011.
I need some help writing a function, or using built in functions to return to me the...
Thanks!! I changed my code. I didn't notice a speed increase, because I have a minimal amount of records! But I took your advice!
I find myself doing more programming then necessary because of my lack of SQL knowledge!
Select count(*)as Total,* from(
Select DateAdd(dd,((DatePart(wk, lib_time)-2)*7)+2,
cast(rtrim(DatePart(yy, lib_time))+'0101' as datetime))
EventWeek, lib_id from lib_visits) as a WHERE lib_id='PROINF' GROUP BY lib_id,EventWeek;
|-Total-|------ EventWeek -----|------|
177 2011-05-02...
Select * from(
Select DateAdd(dd,((DatePart(wk, lib_time)-2)*7)+2,
cast(rtrim(DatePart(yy, lib_time))+'0101' as datetime))
EventWeek, lib_id from lib_visits) as a WHERE lib_id='PROINF' order BY lib_id,EventWeek
|-EventWeek------------|- ID--|
2011-05-02 00:00:00.000 PROINF
2011-05-02...
Hey, thanks again! I think the code will work. I ran it, and it basically grouped all the dates into a certain day (the beginning of that week), I ordered it by ID, and then by the week. I can use some Java to do the counts.
As for "UnsolvedCoding"...... I am know idea what he is talking about...
Holy smokes!!!
Question: What is "intVal" and "EventWeek", and what's '0101' doing?
Select * from(
Select visit_time, DateAdd(dd,((DatePart(wk, visit_time)-2)*7)+2,
cast(rtrim(DatePart(yy, visit_time))+'0101' as datetime))
EventWeek, intVal from visits) as a
Right now I am getting a "Invalid...
Very good point Lodlaiden!
I am going to have to do a bit of soul searching on that one. If the first week of July has only 2 days in it, then the data will be inconsistent when comparing it to other "first weeks" of the month. July has only 2 days in the first week, August has 6. August will...
George,
Thanks for offering help! I could use some, as it would save me time vs. using the guess and test method!
I finished the monthly report yesterday thanks to your guys help! I'm going to try and tackle the weekly report this afternoon.
I neglected to say last time that I am also...
Thanks Qik3Coder and Gmmastros. I didn't know the DatePart function, so I have added that to the list of useful sql functions to understand. I ended up tweaking Gmmastros SQL to suit my needs! It works great for the monthly reports, but I have a feeling I will need to use the "DatePart" function...
Hello everyone,
I am having trouble making a decision on which direction to go.
I have several users with unique ID's and I am tracking visitor information, time, day, month, year, based on that ID and the month.
Plan A,
12 Select Statements (1 for each month) to get a monthly visitor...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.