Jump to content

packrat

Members
  • Posts

    61
  • Joined

  • Last visited

Everything posted by packrat

  1. knowing ColdFusion is like being fluent in conversational latin

  2. Just installed FireBug, looks promising, have to use it for a bit.I did have to install it, restart, uninstall, restart, and install again before it showed up correctly; might only need to restart twice... anywho - it works.IE Developer Toolbar isn't terrible from a functional standpoint, but I agree its 'graphically poor' -- looks like someone went out of there way to make it look like it was written in some old version of visual basic.
  3. packrat

    box in box etc...

    FireFox will display empty divs as will IE7 (and probably opera & safari), IE6 will not display empty divs but you can trick it by nesting an empty span inside.This is useful when the nbsp is undesirable for one reason or another.<div style="height:4px; width:40px; margin:auto; border:1px dotted #DDE;"><span></span></div>
  4. I'm on board as well, the FF Web Developer tool bar is a must have; my only complaint is that if you have the plugin to switch rendering engines and switch to the IE rendering engine the tools pretty much don't work in IE mode -- but hey we can't expect them to fix all of microsoft's shortcommings.The 'developer toolbar' for IE leaves a lot to be desired, its crashed XP on me at least once and is otherwise not nearly as pleasant or intuitive. My main complaint about the IE tools is that you have to click on each menu to open it, you can't focus the control then mouse over to navigate the way you do in pretty much every other menu for the last decade. Its just a silly UI issue that should take about 20 minutes to fix - which means it'll never happen.My favorite item has to be [information] > [display element information] (CTL+SHIFT+F) it can't be much more convenient that that.
  5. Here are a couple links to some tutorial that helped me a great deal in adopting CSS layout techniques:http://www.csszengarden.com/http://css.maxdesign.com.au/floatutorial/index.htmHaving credited my help resources I'll say that you'll probably want to consider some structural changes in your HTML, the Zen Garden site will give some great insights. I'll not dally into a great amount of detail on this, suffice it to say that the paragraph tag is causing you some headaches. Nothing is telling it to take less than the full available width; Floating the block below it has no effect as is there is no room for it to push up into. A couple of quick fixes to get you started:option #1: move your 'right' block above the paragraph tag but below the h2 tag.option #2: give your paragraph tag a fixed width and tell it to float left.From a SEO perspective option 2 is closer to the correct answer; the articles should help shed some light on why.Another resource: this one is a fun tutorial on "Why tables for layout is stupid"http://www.hotdesign.com/seybold/index.htmllet me know how it goes.
  6. did you try WinHTTP?
  7. or in classic asp vb script: on error resume next 'some code if err.number <> 0 then 'handle error end if on error goto 0 error handling is pretty ugly in vb6 / vbscript
  8. packrat

    easy inner join

    the syntax gets a little squirrely around outer, its more confusing than it needs to be.OUTER JOIN only comes into play when you're doing a LEFT or RIGHT join.LEFT JOIN is the same as LEFT OUTER JOINRIGHT JOIN is the same as RIGHT OUTER JOINWhereas an INNER JOIN only return results from either table when the specified key(s) match the OUTER JOIN returns all the rows from the LEFT or RIGHT in the ON portion of the join.i.e: Table1 LEFT OUTER JOIN Table2 ON Table1.key = Table2.keythis returns ALL rows from Table1 and fills all the Table2 results with NULLs where the key does not match.RIGHT simply reverses this so that:i.e: Table1 RIGHT OUTER JOIN Table2 ON Table1.key = Table2.keyreturns ALL rows from Table2 and only the matching keys from Table1, filling the unmatched rows with NULLs.You could decide to always write LEFT or RIGHT and you wouldn't be out anything.the significance is that it returns all the rows from the table specified returning NULLs where there is no match to its key.It doesn't help understanding that in most flavors of SQL the OUTER part is optional. This is one of those things that is actually simpler than it seems.
  9. glad to be of help.as far as the function goes, just for the sake of discussion, the function would be called in the select and would be evaluated for each row in the result set. SELECT udf_SubstitutePipes(SC.Comment, SD.Value1, SD.Value1) AS CommentFROM StockComment SC INNER JOIN StockDetailComment SD ON SC.StockCommentID = SD.StockCommentID if you're happy with it, or just want to get away from it, then by all means call it done.
  10. packrat

    SUMS and Totals

    Note the CEUFilter subquery below, this will restrict results to ContactID's with more than 5 overall hours. DECLARE @from datetime, @to datetimeSET @from = CONVERT(varchar(11), @MinDate, 1)SET @to = CONVERT(varchar(11), @Maxdate, 1)SELECT DISTINCT EducationCreditHistory.ContactID , EducationCreditHistory.CourseID , contactbase.FirstName , contactbase.LastName , Courses.CourseCode , Courses.StartDate , EdCategoryXref.Category , EdCategoryXref.CEUs , OpportunityBase.Name , Contact.ContactId AS Expr1FROM EducationCreditHistory INNER JOIN contactbase ON EducationCreditHistory.ContactID = contactbase.ContactId INNER JOIN Courses ON EducationCreditHistory.CourseID = Courses.CourseID INNER JOIN EdCategoryXref ON EducationCreditHistory.TransactionID = EdCategoryXref.TransactionID INNER JOIN OpportunityBase ON EducationCreditHistory.ContactID = OpportunityBase.ContactId INNER JOIN Contact ON contactbase.ContactId = Contact.ContactId INNER JOIN ( EducationCreditHistory.ContactID, SUM(EdCategoryXref.CEUs) SumCredits FROM EducationCreditHistory INNER JOIN EdCategoryXref ON EducationCreditHistory.TransactionID = EdCategoryXref.TransactionID GROUP BY EducationCreditHistory.ContactID HAVING SUM(EdCategoryXref.CEUs) > 5 ) CEUFilter ON EducationCreditHistory.ContactID = CEUFilter.ContactID WHERE (CONVERT(varchar(11), Courses.StartDate, 1) >= @from) AND (CONVERT(varchar(11), Courses.StartDate, 1) <= @to) AND (OpportunityBase.Name = N'AAAFEE05 - CE REGISTRY FEE')ORDER BY contactbase.LastName, Courses.CourseCode
  11. ISNULL(Value, '')unlike access where ISNULL return boolean, MsSql ISNULL substitutes the second param for null values, that should take care of the null problem.select Result = Part1 + ISNULL(Value1, '') + Part2 + ISNULL(Value2, '') + Part3Since you're on SQL, if you can write a function to do this your final select would be a lot cleaneri.e. udf_SubstitutePipes(Comment, Replacement1, Replacement2)
  12. packrat

    easy inner join

    practive miffe, practice. I think it took me about a year to really get my head around all the various joins.I've noticed that the query editors tend to put the tables in some odd arrangements, I wouldn't pay too much attention to the way that the automated tools build joins. I tend to put them in the logical order of my query; if i'm querying order info my first table would be orders then order details, then the products table if need be. The optimizer is pretty good at figuring out what it wants to do.My other recomendation while you learning joins is to make extensive use of sub queries. In most cases a subquery can be collapsed into a join condition but it can save your behind of you're floundering over a join. At the very least the subquery helps segment the logic so you can keep track of what the parts are doing, you can more easily test the components that way. I'd say that more than half the time my all join queries run about the same speed as my subquery queries. Again the optimizer is pretty good at figuring out what it wants to do.
  13. It ain't pretty but here's your access solution, if you're using jet/access not sql server. SELECT IIF (InStr(1, SC.Comment, '|')>0 , IIF (InStr(InStr(1, SC.Comment, '|')+1, SC.Comment, '|') > 0 , LEFT(SC.Comment, InStr(1, SC.Comment, '|')-1) & SD.Value1 & MID(SC.Comment, InStr(1, SC.Comment, '|')+1, InStrRev(SC.Comment, '|')-(InStr(1, SC.Comment, '|')+1)) & SD.Value2 & Right(SC.Comment, Len(SC.Comment) - InStrRev( SC.Comment, '|')) , Replace(SC.Comment, '|', SD.Value1) ) , SC.Comment ) AS CommentFROM StockComment SC INNER JOIN StockDetailComment SD ON SC.StockCommentID = SD.StockCommentID someone tell me how to keep code indented when posting....
  14. Query analyzer? is this Access connected to an SQL server (ADP file)? if so do you have permissions to write functions?if not pls elaborate on query analyzer
  15. I think that the division operation might be getting you into trouble, I don't know your data but I can see that @p is an INT which the /100 operation may be violating.Also why are we passing @p in as a parameter when we're not going to use the value passed?how is it not working? errors? no output? what's the db platform?
  16. is this for any particular database platform?are the pipe chars mixed in with the comment or do the fields with pipes only contain pipe chars?do you have control over these delimiters, can you decide to change delimiters or is that beyond your control?my only other comment at this time is that the problem as posed would likely be easier to deal with on the code side, the easy db side fix would probably require a stored procedure or function to cope with the string parsing.
  17. it sounds like you have a lot of redundancy, the only real data is the run of numbers 1-2000. I don't understand the rationale for having an autonumber column and a number column that must necessarily have the same data. Perhapps I misunderstand the purpose of the autonumber column.If your goal is to expose the number in the number column and a string equivalent with 'G' as a suffix you may accomplish this using a access query. SELECT [Table].[NumberColumn] [Table].[NumberColumn] & 'G' AS TextColumnFROM [Table] You reference the query rather than the table in your select statements.If you need to populate the initial run of numbers I'd recommend using Access VBA, write a little module to populate the initial data. This example might not be a perfect match for what you're trying to do, but it seems close. Sub PopulateNumberTable() Dim AdoCmd As ADODB.Command Dim iNbr As Integer AdoCmd.ActiveConnection = Access.CurrentProject.Connection While iNbr < 2000 AdoCmd.CommandText = "INSERT INTO [table] ([NumberColumn]) VALUES (" & iNbr & ")" AdoCmd.Execute iNbr = iNbr + 1 Wend Set AdoCmd = NothingEnd Sub ... Also, if your number + 'G' is the intended primary key and the letter will always be 'G', then use the number as the primary key in itself as there is no differentiation introduced by adding a constant onto the end of the entire range.I also don't see any problem with jesh's suggestion that you append the 'G' at runtime.
  18. packrat

    ASP Email system

    I'm going to make the same comment I've been making about sending mail from your site, check with your ISP.See if your ISP offers a form mail integration guide. If the ISP's support is thorough at all they should have a snippet posted in their online support that details how to do this.Some ISP's don't even allow CDO, having replaced it with some other comparable component.Here's an example from the MSDN:http://msdn2.microsoft.com/en-us/library/ms873694.aspxif you read this example on MSDN, pay attention to the cdo.configuration object, this is used to provide authentication credentials to the mail server and is likely required by your ISP if they are using CDO / Exchange.also in this case, the 'from' address is usually going to have to be a real email address, registered to the domain name you're trying to send from.
  19. I'd check with your ISP's technical support, see if they have any integration guides / help files that outline site mail integration. The rules for doing this vary somewhat from ISP to ISP, as far as what hoops you have to jump through to send mail.If your ISP's support is worth its salt they should have a little bit of script posted in their support section that you can just copy and work with.The basic syntax is: Dim MailSet Mail=Server.CreateObject("CDONTS.NewMail")Mail.To = <ToAddress>Mail.From = <FromAddress>Mail.Subject = <Your Subject>Mail.BodyFormat = 0 'This indicates HTMLMail.Body = <Your HTML>Mail.SendSet Mail = Nothing Here's a more built up example from the MSDNhttp://msdn2.microsoft.com/en-us/library/ms873694.aspxUltimately the 'rules' will depend on your ISP.good luck!
  20. packrat

    Linked servers

    Its been a little while since I've delved into linked servers, which means I can no longer find my source code that uses this, ... but as I recall it the server will be registered whether or not it can connect. With this command I'm assuming that you're trying to connect to another sql server instance on the same box, is this correct?If so, does it use the same authentication method as the server you're calling from?I'd think that it is connecting, hence the failed authentication message rather than the 'server not responding' message.I'll see if I can dig anything else up.
  21. packrat

    Survey app

    sorry, I'm apparently having trouble with posting duplicates, I swear I'm not hitting the button 5 times. sorry.
  22. packrat

    Survey app

    sorry, I'm apparently having trouble with posting duplicates, I swear I'm not hitting the button 5 times. sorry.
  23. packrat

    Survey app

    sorry, I'm apparently having trouble with posting duplicates, I swear I'm not hitting the button 5 times. sorry.
  24. packrat

    Survey app

    The answer depends on the degree of flexibillity and control you require.The easiest solution is probably to have a wide table of bit/boolean checks enumerating each answer option:AnswerTable: RespondantId, Q1A1, Q1A2, Q1A3, Q2A1, Q2A2, Q2A3, Q3...This allows you to handle questions that allow multiple answers. Simply having one int/varchar column to record the index or text of the answer is fine as long as you don't have any multiple choice options.Write-in / other answers can be recorded in the same structure in line as: Q[n]Other.One advantage of this technique is that the bit columns take up very little space allowing you to make a very wide table if need be. Reporting queries will be wordy by easy to write.However, this solution breaks the rules of relational data... if you care about that sort of thing.........The relational answer might look something more like this:SurveyQuestionsTable: Qid, Qtext, Qsort, Qtype (single,multiple,single+other,multiple+other) Qtype specifies wether multiple responses are allowed and may give hints to the app as to which control to use (checks / radios)
  25. packrat

    Complex Select

    yea, I suppose that my example would return nothing if it didn't get a hit on one of the specified dateparts, ns what you'd want to return if you don't get the specified datepart and there is no '0' to fall back on... If you need help with that part I'll try to pitch in.Subqueries can really help segment the logic so its easier to understand the steps.Temporary tables can be a god-send as well, especially if you have some complex sub query that you have to use in several places at once (such as running a variety of aggregates in a reporting scenario)cheers;
×
×
  • Create New...