Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. ProInfo

    Counting distinct values for multiple months

    I get 1328 rows.
  2. ProInfo

    Counting distinct values for multiple months

    372 unique zipcodes :)
  3. ProInfo

    Counting distinct values for multiple months

    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...
  4. ProInfo

    Counting distinct values for multiple months

    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...
  5. ProInfo

    Counting distinct values for multiple months

    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 |...
  6. ProInfo

    Left Join? Need to combine a "log table" with an "accounts table"

    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...
  7. ProInfo

    Left Join? Need to combine a "log table" with an "accounts table"

    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...
  8. ProInfo

    Java is a huge cup of coffee!

    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...
  9. ProInfo

    Get starting date of first week in a year.

    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)...
  10. ProInfo

    Learning Java

    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...
  11. ProInfo

    Get starting date of first week in a year.

    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...
  12. ProInfo

    Pure SQL or SQL + Programming

    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!
  13. ProInfo

    Pure SQL or SQL + Programming

    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...
  14. ProInfo

    Pure SQL or SQL + Programming

    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...
  15. ProInfo

    Pure SQL or SQL + Programming

    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...
  16. ProInfo

    Pure SQL or SQL + Programming

    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...
  17. ProInfo

    Pure SQL or SQL + Programming

    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...
  18. ProInfo

    Pure SQL or SQL + Programming

    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...
  19. ProInfo

    Pure SQL or SQL + Programming

    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...
  20. ProInfo

    Pure SQL or SQL + Programming

    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...

Part and Inventory Search

Back
Top