Search Results

Search found 4237 results on 170 pages for 'delphi 2009'.

Page 85/170 | < Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >

  • calculating offer period for subscription

    - by TheVillageIdiot
    I'm maintaining a web application which deals with some kind of subscriptions. Users can to renew their subscriptions from 2 months before expiry (not earlier than that). Sometimes user does not renew before expiry and get grace period which is of 3 months. Now he can renew in these 3 months of grace period. Now the problem part. In the previous transactions of renew requests I have to show what was the offer period for that particular request (subscription start and subscription end period if renew was granted). Things are pretty simple if user renews before expiry, but I'm not able to get things straight if there is grace period specially when the subscriptions is expiring in last months of the year. Also there sometimes calculations go haywire when subscription is ending in jan or feb. All this is happening because offer period is not saved with the application anywhere (I don't know why). so if subscription is ending in 20 October 2008 and renew application is submitted in 16 January 2009 (because of grace period) the offer period should be 21 October 2008 to 20 October 2009.

    Read the article

  • How to move a symlink to the trash?

    - by neoneye
    I don't see any options for the FSPathMoveObjectToTrashSync() function for not following links. Here is what I have tried Create a link and a file [ 21:32:41 /tmp ] $ touch my_file [ 21:32:45 /tmp ] $ ln -s my_file my_link [ 21:32:52 /tmp ] $ la total 8 drwxrwxrwt 12 root wheel 408 17 Maj 21:32 . drwxr-xr-x@ 6 root wheel 204 9 Sep 2009 .. -rw-r--r-- 1 neoneye wheel 0 17 Maj 21:32 my_file lrwxr-xr-x 1 neoneye wheel 7 17 Maj 21:32 my_link -> my_file Move the link to the trash OSStatus status = FSPathMoveObjectToTrashSync( "/tmp/my_link", NULL, kFSFileOperationDefaultOptions ); NSLog(@"status: %i", (int)status); Output is status: 0 However the file got removed and not the link [ 21:32:55 /tmp ] $ la total 8 drwxrwxrwt 11 root wheel 374 17 Maj 21:33 . drwxr-xr-x@ 6 root wheel 204 9 Sep 2009 .. lrwxr-xr-x 1 neoneye wheel 7 17 Maj 21:32 my_link -> my_file [ 21:33:05 /tmp ] $ How can I move move symlinks to the trash? The Solution.. thanks to Rob Napier NSString* path = @"/tmp/my_link"; OSStatus status = 0; FSRef ref; status = FSPathMakeRefWithOptions( (const UInt8 *)[path fileSystemRepresentation], kFSPathMakeRefDoNotFollowLeafSymlink, &ref, NULL ); NSAssert((status == 0), @"failed to make FSRef"); status = FSMoveObjectToTrashSync( &ref, NULL, kFSFileOperationDefaultOptions ); NSLog(@"status: %i", (int)status);

    Read the article

  • Mysql return value as 0 in the fetch result.

    - by Karthik
    I have this two tables, -- -- Table structure for table `t1` -- CREATE TABLE `t1` ( `pid` varchar(20) collate latin1_general_ci NOT NULL, `pname` varchar(20) collate latin1_general_ci NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; -- -- Dumping data for table `t1` -- INSERT INTO `t1` VALUES ('p1', 'pro1'); INSERT INTO `t1` VALUES ('p2', 'pro2'); -- -------------------------------------------------------- -- -- Table structure for table `t2` -- CREATE TABLE `t2` ( `pid` varchar(20) collate latin1_general_ci NOT NULL, `year` int(6) NOT NULL, `price` int(3) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; -- -- Dumping data for table `t2` -- INSERT INTO `t2` VALUES ('p1', 2009, 50); INSERT INTO `t2` VALUES ('p1', 2010, 60); INSERT INTO `t2` VALUES ('p3', 2007, 200); INSERT INTO `t2` VALUES ('p4', 2008, 501); my query is, SELECT * FROM `t1` LEFT JOIN `t2` ON t1.pid = t2.pid Getting the result, pid pname pid year price p1 pro1 p1 2009 50 p1 pro1 p1 2010 60 p2 pro2 NULL NULL NULL My question is, i want to get the price value is 0 instead of NULL. How can i write the query to getting the price value is 0. Thanks in advance for help.

    Read the article

  • PHP Regex to match lines with all-caps with occaisional hyphens.

    - by Yaaqov
    I'm trying to to convert an existing PHP Regular Expression match case to apply to a slightly different style of document. Here's the original style of the document: **FOODS - TYPE A** ___________________________________ **PRODUCT** 1) Mi Pueblito Queso Fresco Authentic Mexican Style Fresh Cheese; 2) La Fe String Cheese **CODE** Sell by date going back to February 1, 2009 And the successfully-running PHP Regex match code that only returns "true" if the line is surrounded by asterisks, and stores each side of the "-" as $m[1] and $m[2], respectively. if ( preg_match('#^\*\*([^-]+)(?:-(.*))?\*\*$#', $line, $m) ) { // only for **header - subheader** $m[2] is set. if ( isset($m[2]) ) { return array(TYPE_HEADER, array(trim($m[1]), trim($m[2]))); } else { return array(TYPE_KEY, array($m[1])); } } So, for line 1: $m[1] = "FOODS" AND $m[2] = "TYPE A"; Line 2 would be skipped; Line 3: $m[1] = "PRODUCT", etc. The question: How would I re-write the above regex match if the headers did not have the asterisks, but still was all-caps, and was at least 4 characters long? For example: FOODS - TYPE A ___________________________________ PRODUCT 1) Mi Pueblito Queso Fresco Authentic Mexican Style Fresh Cheese; 2) La Fe String Cheese CODE Sell by date going back to February 1, 2009 Thank you.

    Read the article

  • Help with SQL Server query

    - by Travis
    Sorry* this is what I should have put My query is creating duplicate entries for any record that has more than 1 instance (regardless of date) <asp:SqlDataSource ID="EastMonthlyHealthDS" runat="server" ConnectionString="<%$ ConnectionStrings:SNA_TRTTestConnectionString %>" SelectCommand="SELECT [SNA_Parent_Accounts].[Company], (SELECT [Monthly_HIP_Reports].[AccountHealth] from [Monthly_HIP_Reports] where ([Monthly_HIP_Reports].[YearMonth] = @ToDtRFC) AND ([SNA_Parent_Accounts].[CompID] = [Monthly_HIP_Reports].[CompID])) as [AccountHealth], [SNA_Parent_Accounts].[CompID] FROM [SNA_Parent_Accounts] LEFT OUTER JOIN [Monthly_HIP_Reports] ON [Monthly_HIP_Reports].[CompID] = [SNA_Parent_Accounts].[CompID] WHERE (([SNA_Parent_Accounts].[Classification] = 'Business') OR ([SNA_Parent_Accounts].[Classification] = 'Business Ihn')) AND ([SNA_Parent_Accounts].[Status] = 'active') AND ([SNA_Parent_Accounts].[Region] = 'east') ORDER BY [SNA_Parent_Accounts].[Company]"> <SelectParameters> <asp:ControlParameter ControlID="ddMonths" Name="ToDtRFC" PropertyName="Text" Type="String" /> </SelectParameters> </asp:SqlDataSource> Using SELECT DISTINCT appears to correct the problem, but I don't consider that a solution. There are no duplicate entries in the database. So it appears my query is superfically creating duplicates. The query should grab a list of companies that meet the criteria in the where clause, but also grab the Health status for each company in that particular [YearMonth] if present which is what the subquery is for. If an entry for that YearMonth is not present, then leave the Health status blank. but as stated earlier.. if you have an entry say for 2009-03 for CompID 2 and an entry for 2009-04 for CompID 2.. Doesn't matter what month you select it will list that company 2-3 times.

    Read the article

  • Calculate the year for ending month/day?

    - by Dave Jarvis
    Given: Start Year Start Month & Start Day End Month & End Day What SQL statement results in TRUE if a date lands between the Start and End days? 1st example: Start Date = 11-22 End Date = 01-17 Start Year = 2009 Specific Date = 2010-01-14 TRUE 2nd example: Start Date = 11-22 End Date = 11-16 Start Year = 2009 Specific Date = 2010-11-20 FALSE 3rd example: Start Date = 02-25 End Date = 03-19 Start Year = 2004 Specific Date = 2004-02-29 TRUE I was thinking of using the MySQL functions datediff and sign plus a CASE condition to determine whether the year wraps, but it seems rather expensive. Am looking for a simple, efficient calculation. Update 1 The problem is the end date cannot simply use the year. The year must be increased if the end month/day combination happens before the start date. The start date is easy: Start Date = date( concat_ws( '-', year, Start Month, Start Day ) ) The end date is not so simple. Update 2 Here is what I was thinking about for obtaining the end year: end_year = case sign( diff( date( concat_ws( year, start_month, start_day ) ), date( concat_ws( year, end_month, end_day ) ) ) ) when -1 then Start_Year + 1 else Start_Year end case Then wrap that expression (once syntactically correct) inside of another date, followed by BETWEEN statement. Update 3 To clear up some confusion: there is no end year. The end year must be calculated. Thank you!

    Read the article

  • Floated element not included in parent, causing margin-bottom problems

    - by Christian Mann
    Right, so I've got a section of a page: <div class="article"> <div class="author"> <img src="images/officers/john_q_public_thm.jpg" /> <span class="name">John Q. Public</span> <span class="position">President</span> </div> <abbr class="postdate"> <span class="month m-01">Jan</span> <span class="day d-31">31</span> <span class="year y-2009">2009</span> </abbr> <div class="content"> <h2 class="title">Article Title</h2> <p>Pellentesque habitant morbi...facilisis luctus, metus</p> <p>Pellentesque habitant morbi...facilisis luctus, metus</p> </div> </div> <div class="article">...</div> <div class="article">...</div> The author and abbr divs are floated to the left. Each one of these article divs needs to be separated from its siblings by 5px or so. However, the author div is extending beyond the technical "height" of the div. The margin-bottom is doing nothing, as the space is being taken up by the floated author. This is somewhat difficult to envision, so I've placed it on my web server Is there any way to force the parent to be at least as tall as all of the floated elements within? If anyone figures out what I'm saying, thanks.

    Read the article

  • Returning an integer from a select box - JavaScript

    - by Ross
    Very simply, I want to be able to access the year from the select box as an integer. In my test, my alertbox is telling me the value is undefined. <form name="form1" method="post" action=""> <label>birth year <select name="birth year" id="dueYear"> <OPTION VALUE='' SELECTED>--Year--</OPTION> <OPTION VALUE='2011'>2011</OPTION> <OPTION VALUE='2010'>2010</OPTION> <OPTION VALUE='2009'>2009</OPTION></SELECT> </select> </label> </form> <script type="text/javascript"> var dueDateYear = parseInt(document.getElementById("dueYear")); </script> <button onclick="alert(dueDateYear)">Click Me!</button> All I want it to do, is tell me the year I have selected -- any help would be appreciated, I am a newbie :(

    Read the article

  • SQL server 2005 agent not working

    - by flaggers
    Sql server 2005 service pack 2 version: 9.00.3042.00 All maintenance plans fail with the same error. The details of the error are:- Execute Maintenance Plan Execute maintenance plan. test7 (Error) Messages Execution failed. See the maintenance plan and SQL Server Agent job history logs for details. The advanced information section shows the following; Job 'test7.Subplan_1' failed. (SqlManagerUI) Program Location: at Microsoft.SqlServer.Management.SqlManagerUI.MaintenancePlanMenu_Run.PerformActions() At this point the following appear in the windows event log: Event Type: Error Event Source: SQLISPackage Event Category: None Event ID: 12291 Date: 28/05/2009 Time: 16:09:08 User: 'DOMAINNAME\username' Computer: SQLSERVER4 Description: Package "test7" failed. and also this: Event Type: Warning Event Source: SQLSERVERAGENT Event Category: Job Engine Event ID: 208 Date: 28/05/2009 Time: 16:09:10 User: N/A Computer: SQLSERVER4 Description: SQL Server Scheduled Job 'test7.Subplan_1' (0x96AE7493BFF39F4FBBAE034AB6DA1C1F) - Status: Failed - Invoked on: 2009-05-28 16:09:02 - Message: The job failed. The Job was invoked by User 'DOMAINNAME\username'. The last step to run was step 1 (Subplan_1). There are no entries in the SQl Agent log at all.

    Read the article

  • Convert SWF file to FLV with FFMPEG & getting error "could not find codec parameters"

    - by Ritesh
    Hi I am trying to convert SWF file to FLV, but i am getting same eror C:\Users\Administrator>C:/ffmpeg/ffmpeg.exe -i C:/xampplite/htdocs/ffmpeg/1.swf \ C:/xampplite/htdocs/ffmpeg/file1.flv FFmpeg version SVN-r16573, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: --extra-cflags=-fno-common --enable-memalign-hack --enable-pthreads --enable-libmp3lame --enable-libxvid --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libfaac --enable-libgsm --enable-libx264 --enable-libschroedinger --enable-avisynth --enable-swscale --enable-gpl libavutil 49.12. 0 / 49.12. 0 libavcodec 52.10. 0 / 52.10. 0 libavformat 52.23. 1 / 52.23. 1 libavdevice 52. 1. 0 / 52. 1. 0 libswscale 0. 6. 1 / 0. 6. 1 built on Jan 13 2009 02:57:09, gcc: 4.2.4 C:/xampplite/htdocs/ffmpeg/1.swf: could not find codec parameters Please solve this problem, what i am doing wrong??

    Read the article

  • Refining Search Results [PHP/MySQL]

    - by Dae
    I'm creating a set of search panes that allow users to tweak their results set after submitting a query. We pull commonly occurring values in certain fields from the results and display them in order of their popularity - you've all seen this sort of thing on eBay. So, if a lot of rows in our results were created in 2009, we'll be able to click "2009" and see only rows created in that year. What in your opinion is the most efficient way of applying these filters? My working solution was to discard entries from the results that didn't match the extra arguments, like: while($row = mysql_fetch_assoc($query)) { foreach($_GET as $key => $val) { if($val !== $row[$key]) { continue 2; } } // Output... } This method should hopefully only query the database once in effect, as adding filters doesn't change the query - MySQL can cache and reuse one data set. On the downside it makes pagination a bit of a headache. The obvious alternative would be to build any additional criteria into the initial query, something like: $sql = "SELECT * FROM tbl MATCH (title, description) AGAINST ('$search_term')"; foreach($_GET as $key => $var) { $sql .= " AND ".$key." = ".$var; } Are there good reasons to do this instead? Or are there better options altogether? Maybe a temporary table? Any thoughts much appreciated!

    Read the article

  • Append json data to html class name

    - by user2898514
    I have a problem with my json code. I want to append each json value comes from a key to be appended to an html class name which matches the key of json data. here's my Live demo if you see the result in the life demo. it's only appending the last record. is it possible to make it show all records in order? json var json = '[{"castle":"big","commercial":"large","common":"sergio","cultural":"2009"},' + '{"castle":"big2","commercial":"large2","common":"sergio2","cultural":"20092"}]'; html <div class="castle"></div> <div class="commercial"></div> <div class="common"></div> <div class="cultural"></div> javascript var data = $.parseJSON(json); $.each(data, function(l,v) { $.each(v, function(k,o) { $('.'+k).attr('id', k+o); console.log($('#'+k+o).attr('id')); $('#'+k+o).text(o); }); }); for more illustration... I want the result in the live demo to look like this big large sergio 2009, big2 large2 sergio2 20092

    Read the article

  • Get Browser to send both If-None-Match and If-Modified-Since

    - by Glen
    My Browser isn't sending back an If-Modified-Since Header for PHP generated Content on the first request my script sends: (Status-Line) HTTP/1.1 200 OK Date Thu, 21 Jan 2010 08:55:25 GMT Server Apache/2.2.11 (Win32) PHP/5.2.9-1 X-Powered-By PHP/5.2.9-1 Pragma no-cache x-ua-compatible IE=8;FF=3;OtherUA=4 Last-Modfied Sat, 02 Jan 2010 02:02:20 GMT Content-Length 28453 Etag b98e0795b509be20146f58e06fbb624f Keep-Alive timeout=5, max=90 Connection Keep-Alive Content-Type image/png it on the second request it sends: (Request-Line) GET /kincumberunitingchurch/banner_image.php?id=1 HTTP/1.1 Host localhost User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.17) Gecko/2009122116 Firefox/3.0.17 Accept image/png,image/*;q=0.8,*/*;q=0.5 Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 300 Connection keep-alive Referer http://localhost/kincumberunitingchurch/index.php?sid=tgl9jq3f71nau3cj9vps6pna03 Cookie sid=tgl9jq3f71nau3cj9vps6pna03; PHPSESSID=m0jvven6d7l65pl6odm9ecfnt4 If-None-Match b98e0795b509be20146f58e06fbb624f Cache-Control max-age=0 for other files the sever sends first: (Status-Line) HTTP/1.1 200 OK Date Thu, 21 Jan 2010 08:55:25 GMT Server Apache/2.2.11 (Win32) PHP/5.2.9-1 Last-Modified Wed, 30 Dec 2009 02:40:58 GMT Etag "1000000013d35-40d9-47be9117f6280" Accept-Ranges bytes Content-Length 16601 Keep-Alive timeout=5, max=84 Connection Keep-Alive Content-Type image/png and my browser send the following on the next request: (Request-Line) GET /kincumberunitingchurch/img/cbuttons.png HTTP/1.1 Host localhost User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.17) Gecko/2009122116 Firefox/3.0.17 Accept image/png,image/*;q=0.8,*/*;q=0.5 Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 300 Connection keep-alive Referer http://localhost/kincumberunitingchurch/mystyle.css Cookie sid=tgl9jq3f71nau3cj9vps6pna03; PHPSESSID=m0jvven6d7l65pl6odm9ecfnt4 If-Modified-Since Wed, 30 Dec 2009 02:40:58 GMT If-None-Match "1000000013d35-40d9-47be9117f6280" Cache-Control max-age=0 why would it send the If-Modified-Since header

    Read the article

  • Why does my Perl CGI program fail with "Software error: ..."?

    - by kiran
    When I try to run my Perl CGI program, the returned web page tells me: Software error: For help, please send mail to the webmaster (root@localhost), giving this error message and the time and date of the error. Here is my code in one of the file: #!/usr/bin/perl use lib "/home/ecoopr/ecoopr.com/CPAN"; use CGI; use CGI::FormBuilder; use CGI::Session; use CGI::Carp (fatalsToBrowser); use CGI::Session; use HTML::Template; use MIME::Base64 (); use strict; require "./db_lib.pl"; require "./config.pl"; my $query = CGI-new; my $url = $query-url(); my $hostname = $query-url(-base = 1); my $login_url = $hostname . '/login.pl'; my $redir_url = $login_url . '?d=' . $url; my $domain_name = get_domain_name(); my $helpful_msg = $query-param('m'); my $new_trusted_user_fname = $query-param('u'); my $action = $query-param('a'); $new_trusted_user_fname = MIME::Base64::decode($new_trusted_user_fname); ####### Colin: Added July 12, 2009 ####### my $view = $query-param('view'); my $offset = $query-param('offset'); ####### Colin: Added July , 2009 ####### #print $session-header; #print $new_trusted_user; my $helpful_msg_txt = qq[]; my $helpful_msg_div = qq[]; if ($helpful_msg)

    Read the article

  • AWK: compare apache dates without using regular expression

    - by smallmeans
    I'm writing a loganalysis application and wanted to grab apache log records between two certain dates. Assume that a date is formated as such: 22/Dec/2009:00:19 (day/month/year:hour:minute) Currently, I'm using a regular expression to replace the month name with its numeric value, remove the separators, so the above date is converted to: 221220090019 making a date comparison trivial.. but.. Running a regex on each record for large files, say, one containing a quarter million records, is extremely costly.. is there any other method not involving regex substitution? Thanks in advance Edit: here's the function doing the convertion/comparison function dateInRange(t, from, to) { sub(/[[]/, "", t); split(t, a, "[/:]"); match("JanFebMarAprMayJunJulAugSepOctNovDec", a[2]); a[2] = sprintf("%02d", (RSTART + 2) / 3); s = a[3] a[2] a[1] a[4] a[5]; return s >= from && s <= to; } "from" and "to" are the intervals in the aforementioned format, and "t" is the raw apache log date/time field (e.g [22/Dec/2009:00:19:36)

    Read the article

  • Further filter SQL results

    - by eric
    I've got a query that returns a proper result set, using SQL 2005. It is as follows: select case when convert(varchar(4),datepart(yyyy,bug.datecreated),101)+ ' Q' +convert(varchar(2),datepart(qq,bug.datecreated),101) = '1969 Q4' then '2009 Q2' else convert(varchar(4),datepart(yyyy,bug.datecreated),101)+ ' Q' +convert(varchar(2),datepart(qq,bug.datecreated),101) end as [Quarter], bugtypes.bugtypename, count(bug.bugid) as [Total] from bug left outer join bugtypes on bug.crntbugtypeid = bugtypes.bugtypeid and bug.projectid = bugtypes.projectid where (bug.projectid = 44 and bug.currentowner in (-1000000031,-1000000045) and bug.crntplatformid in (42,37,25,14)) or (bug.projectid = 44 and bug.currentowner in (select memberid from groupmembers where projectid = 44 and groupid in (87,88)) and bug.crntplatformid in (42,37,25,14)) group by case when convert(varchar(4),datepart(yyyy,bug.datecreated),101)+ ' Q' +convert(varchar(2),datepart(qq,bug.datecreated),101) = '1969 Q4' then '2009 Q2' else convert(varchar(4),datepart(yyyy,bug.datecreated),101)+ ' Q' +convert(varchar(2),datepart(qq,bug.datecreated),101) end, bugtypes.bugtypename order by 1,3 desc It produces a nicely grouped list of years and quarters, an associated descriptor, and a count of incidents in descending count order. What I'd like to do is further filter this so it shows only the 10 most submitted incidents per quarter. What I'm struggling with is how to take this result set and achieve that.

    Read the article

  • How can I make "month" columns in Sql?

    - by Beska
    I've got a set of data that looks something like this (VERY simplified): productId Qty dateOrdered --------- --- ----------- 1 2 10/10/2008 1 1 11/10/2008 1 2 10/10/2009 2 3 10/12/2009 1 1 10/15/2009 2 2 11/15/2009 Out of this, we're trying to create a query to get something like: productId Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec --------- ---- --- --- --- --- --- --- --- --- --- --- --- --- 1 2008 0 0 0 0 0 0 0 0 0 2 1 0 1 2009 0 0 0 0 0 0 0 0 0 3 0 0 2 2009 0 0 0 0 0 0 0 0 0 3 2 0 The way I'm doing this now, I'm doing 12 selects, one for each month, and putting those in temp tables. I then do a giant join. Everything works, but this guy is dog slow. I know this isn't much to go on, but knowing that I barely qualify as a tyro in the db world, I'm wondering if there is a better high level approach to this that I might try. (I'm guessing there is.) (I'm using MS Sql Server, so answers that are specific to that DB are fine.) (I'm just starting to look at "PIVOT" as a possible help, but I don't know anything about it yet, so if someone wants to comment about that, that might be helpful as well.)

    Read the article

  • Processing a resultset to look up foriegn keys (and poulate a new table!)

    - by Gilly
    Hi, I've been handed a dataset that has some fairly basic table structures with no keys at all. eg {myRubishTable} - Area(varchar),AuthorityName(varchar),StartYear(varchar),StartMonth(varcha),EndYear(varchar),EndMonth(varchar),Amount(Money) there are other tables that use the Area and AuthorityName columns as well as a general use of Month and Years so I I figured a good first step was to pull Area and Authority into their own tables. I now want to process the data in the original table and lookup the key value to put into my new table with foreign keys which looks like this. (lookup Tables) {Area} - id (int, PK), name (varchar(50)) {AuthorityName} - id(int, PK), name(varchar(50) (TargetTable) {myBetterTable} - id (int,PK), area_id(int FK-Area),authority_name_id(int FK-AuthorityName),StartYear (varchar),StartMonth(varchar),EndYear(varchar),EndMonth(varchar),Amount(money) so row one in the old table read MYAREA, MYAUTHORITY,2009,Jan,2010,Feb,10000 and I want to populate the new table with 1,1,1,2009,Jan,2010,Feb,10000 where the first '1' is the primary key and the second two '1's are the ids in the lookup tables. Can anyone point me to the most efficient way of achieving this using just SQL? Thanks in advance Footnote:- I've achieved what I needed with some pretty simple WHERE clauses (I had left a rogue tablename in the FROM which was throwing me :o( ) but would be interested to know if this is the most efficient. ie SELECT [area].[area_id], [authority].[authority_name_id], [myRubishTable].[StartYear], [myRubishTable].[StartMonth], [myRubishTable].[EndYear], [myRubishTable].[EndMonth], [myRubishTable].[Amount] FROM [myRubishTable],[Area],[AuthorityName] WHERE [myRubishTable].[Area]=[Area].[name] AND [myRubishTable].[Authority Name]=[dim_AuthorityName].[name] TIA

    Read the article

  • What would be the Better db design for the old db structure?

    - by yawok
    i've a old database where i store the data of the holidays and dates in which they are celebrated.. id country hdate description link 1 Afghanistan 2008-01-19 Ashura ashura 2 Albania 2008-01-01 New Year Day new-year the flaws in the above structure is that, i repeat the data other than date for every festival and every year and every country.. For example, I store a new date for 2009 for ashura and afghanistan .. I tried to limit the redundancy and split the tables as countries (id,name) holidays (id, holiday, celebrated_by, link) // celebrated_by will store the id's of countries separated by ',' holiday_dates (holiday_id, date, year) // date will the full date and year will be as 2008 or 2009 Now i have some problems with the structure too.. consider that i store the holiday like Independence day , its common for more countries but will have different dates. so how to handle this and and the link will have to be different too.. And i need to list the countries which celebrates the same holiday and also when i describe about a single holiday i need to list all the other holidays that country would be celebrating.. And the most of all , i already have huge amount of data in the old tables and i need to split it to the new one once the new design is finalized... Any ideas?

    Read the article

  • How do I fix VMware “Unidentified Networks” in Windows 7 Professional 64-bit SP1?

    - by Francis
    I have recently installed VMware Workstation 7 onto Windows 7 Professional 64-bit SP1 and both VMnet1 and VMnet8 appeared as "Unidentified Networks". I have tried editing HKLM\SYSTEM\CurrentControlSet\Control\Class{4D36E972-E325-11CE-BFC1-08002BE10318}, a tip provided by Mathews (Jul 23, 2009) but both virtual NICs still appeared as "Unidentified Networks". I will need both NICs to be listed as "Work" or "Private" and with Internet Access. What other solutions/workarounds? Thanks!

    Read the article

  • Installing Zend on CentOS is having dependency issues

    - by rax
    I'm trying to install PHP's Zend Server on my CentOS VPS but it's having dependency issues that I can't seem to resolve. zend-server-php-5.2-4.0-73.noarch from Zend_noarch has depsolving problems --> Missing Dependency: php-5.2-gui-zend-server is needed by package zend-server-php-5.2-4.0-73.noarch (Zend_noarch) zend-server-php-5.2-4.0-73.noarch from Zend_noarch has depsolving problems --> Missing Dependency: php-5.2-dev-zend-server is needed by package zend-server-php-5.2-4.0-73.noarch (Zend_noarch) knowledgetree-ce-3.7.0-2.noarch from KTnoarch has depsolving problems --> Missing Dependency: php-5.2-xmlrpc-zend-server is needed by package knowledgetree-ce-3.7.0-2.noarch (KTnoarch) knowledgetree-ce-3.7.0-2.noarch from KTnoarch has depsolving problems --> Missing Dependency: php-5.2-fileinfo-zend-server is needed by package knowledgetree-ce-3.7.0-2.noarch (KTnoarch) zend-server-php-5.2-4.0-73.noarch from Zend_noarch has depsolving problems --> Missing Dependency: php-5.2-zend-extensions is needed by package zend-server-php-5.2-4.0-73.noarch (Zend_noarch) zend-server-php-5.2-4.0-73.noarch from Zend_noarch has depsolving problems --> Missing Dependency: php-5.2-common-extensions-zend-server is needed by package zend-server-php-5.2-4.0-73.noarch (Zend_noarch) Error: Missing Dependency: php-5.2-fileinfo-zend-server is needed by package knowledgetree-ce-3.7.0-2.noarch (KTnoarch) Error: Missing Dependency: php-5.2-xmlrpc-zend-server is needed by package knowledgetree-ce-3.7.0-2.noarch (KTnoarch) Error: Missing Dependency: php-5.2-gui-zend-server is needed by package zend-server-php-5.2-4.0-73.noarch (Zend_noarch) Error: Missing Dependency: php-5.2-common-extensions-zend-server is needed by package zend-server-php-5.2-4.0-73.noarch (Zend_noarch) Error: Missing Dependency: php-5.2-dev-zend-server is needed by package zend-server-php-5.2-4.0-73.noarch (Zend_noarch) Error: Missing Dependency: php-5.2-zend-extensions is needed by package zend-server-php-5.2-4.0-73.noarch (Zend_noarch) When consulting the Google, all I get told is how to install PHP 5.2.* on CentOS. According to the output of php -v, I've done that. PHP 5.2.8 (cli) (built: Sep 28 2009 15:37:15) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies with the ionCube PHP Loader v3.1.34, Copyright (c) 2002-2009, by ionCube Ltd. How can I solve this issue?

    Read the article

  • Buying used MacBook, what to look at?

    - by Wojtek
    I'm planning to buy used MacBook, I'm looking for more recent models, but detailed specification is not important. I would like to know what should I especially look at when buying used MacBook? What are common flaws in those models (manufactured 2009/2010)? I don't care about minor damages, like scratches, but would like to know what symptoms of repair/previous damage/possible failures in the future are?

    Read the article

  • Magic Mouse and Alum keyboard autosleep?

    - by Moshe
    How does the power management of the wireless keyboard and magic mouse work with iMac? (late 2009) Do I need to manually power off the keyboard and mouse when I shut off my Mac or do they power off/sleep automatically? ( BONUS: How often should the batteries be replaced? )

    Read the article

< Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >