Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 4th, 2004, 05:19 AM
Twilight Twilight is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 2 Twilight User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 46 sec
Reputation Power: 0
Angry Dates confusion between US and UK format

Using the following lookup on 4th February 2004

testdate = DLookup("Endate", "tblBaseRates", "tblBaseRates.EnDate = #04/02/2004#")

it's returning a null value.

4th February 2004 does exist in the table.

If I change the value to #02/04/2004# (2nd April 2004) it returns this as the value.

If I run a query using the Query Grid to find the correct BAseRate record using as criteria tblBaseRates.StDate <=#02/4/2004# AND tblBaseRates.EnDate > =#02/04/2004# then it returns Baserate record with an STDate of 05/02/04 which is what I expect.

If I run that same query as vba code, substituting variables for the criteria date, it returns the Base Rate record that has an EnDate of 04/02/04

I'm further confused by the fact that the Query Grid when viewed in SQL has transposed 02/04/04 to 04/02/04 but still returns the anticipated record.

This is part of a routine where I'm trying to calculate Interest costs for transactions. The Base rate can change during the life of the transaction, and I need to accumulate the interest for the whole life of the transaction. The routine will handle multiple transactions, each with independant "interest start dates"
The interest rates, and start and end dates for each interest band are held in tblBaseRates and the transactions in tblTransactions

Any ideas would be much appreciated. currently I'm looping through the transaction table, then with each transaction looping through the baserate table, accumulating interest cost as I go. With several thousand transactions it's a very slow way to get the result. Any ideas on a better solution would be appreciated. That said, if I can't resolve the Dates issue, I'm at a dead end anyway.

Last edited by Twilight : April 4th, 2004 at 05:54 AM. Reason: Description incorrect

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > Dates confusion between US and UK format


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway