|
select * from table1 where mydate between @startdate and @enddate . Take a look at UTC and datetime formats to make sure that you are working with your date properly (you are using a stored procedure aren't you - and you are passing @startdate and @enddate in as datetime).
-- modified at 4:36 Tuesday 13th November, 2007
Ah - I see from others that you are trying to solve a different problem. Oh well.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete,
Unless and untill we get to know what solution was exactly required, we are not very sure of the problem.
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
|
hi
while @fromdate<=@todate
begin
print dateadd(day,1,@fromdate)
set @fromdate=dateadd(day,1,@fromdate)
end
try this
Regards
Joe
|
|
|
|
|
Hello there guys.
Im using MS Access to store colleague's ID numbers and now I need to only the third to till the sixth digits of the ID number to determine if the person's birthday is today.(i.e 840920 5992 081 and I only take 0920 to and check if they are equal to today)
Does anyone knw how to do that.Ive tried to trim it and take only those digits but nothing works.
Thanx in advance.
kagiso
|
|
|
|
|
Hi,
Currently what datatype you are using for storing date of birth?
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Hi Adeel.
My Birthdate is a string. Same as the IDNumber.
Thanx in advance.
kagiso
|
|
|
|
|
|
Thank you very much.It helped a lot
kagiso
|
|
|
|
|
Hello,
If I want a table with decimal then what is te syntax I should use to create the table.
I have doubt about the data type to be used "decimal(10,2)"
Is the following right?
Create Table Sales (Amt decimal(10,2))
Thanks
Prithaa
|
|
|
|
|
Have you tried it?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hello,
Yes I have tried it and it gives me field definition error.
I think the problem lies in declaring right kind of data type . decimal(10,2) or numeric(10,2) doesn't work.
Pritha
|
|
|
|
|
The syntax you gave in your original post works for me. There must be another error in your code. Have you posted all your code?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
When posting a question like this, you may want to include information such as the database you are using. It could be that you we try something on SQL Server that works, and you think we're looking at Access.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
try this
create table<table name>(<br />
<field1> <datatype>,<br />
<field2> <datatype>,<br />
<field3> <datatype>,<br />
..................,<br />
..................,<br />
..................,<br />
<fieldn> <datatype><br />
)
|
|
|
|
|
Hello,
Thanks for your replies
I am using this in Access.The statement
Create Table Sales (Amt decimal(10,2)) is written in Access.
I get the error Syntax error in field definition.
Prithaa
|
|
|
|
|
Message: Clicking on the following menu items does nothing.
View -> Server Explorer
Tools -> Connect to database
Tools -> Connect to server
Please advise.
Manish Ganguly
|
|
|
|
|
hi
presess Ctrl+Alt+S
try it..
|
|
|
|
|
Hi joe,
tried it. no luck.
What is it suppose to do?
Manish
|
|
|
|
|
FINALLY GOT IT....
HAD TO TYPE THE FOLLOWING IN THE COMMAND PROMPT
devenv /resetskippkgs
|
|
|
|
|
hi do u try this key (ctrl+alt+L)
|
|
|
|
|
hey all,
I think this is more problems with the computers i am working on, i don;t have administrator rights, rather than the database itself...
I have a database file that i would to have as many applications to access it as possible, but the problem is since i don't have the rights the sql server reportst that under default configurations remote connections cannot be established. However when i add it to each individual application is added it and works fine.
My question is, is there a way i can have a central database as i would do if i could have sql server running?
I am using C# as the programming language.
Thanks all,
Best regards...
Luis E Tineo S
|
|
|
|
|
You mean, you wanna host the SQL database locally, right?
If you are using SQL 2000, you can install MSDE on your Windows 2000, XP. or you can install SQL server if your OS is the server-type (e.g. Windows 2000 Advanced Server or Windows 2003)
If you are using SQL 2005, you can install SQL 2005 Express (Advanced setup that includes the Management Studio) on your Windows XP or Vista.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Let's say there are three tables (Customers, Stocks, CustomersStocks) in my database.
Customers
- CustomerID
- CustomerName
Stocks
- StockID
- Stockname
CustomersStocks
- CustomerID
- StockID
My question is ~ How can I get the list of customers who own all stocks?
For example, I have the data as below ~
Customers
- 1 | Michael
- 2 | Julia
- 3 | Lilian
Stocks
- 1 | Apple
- 2 | Orange
CustomersStocks
- 1 | 1
- 2 | 1
- 3 | 1
- 3 | 2
- 1 | 1
I wanna get the list of customers who own all stocks. In my example, the result will be "Lilian" . (should NOT include "Michael" as he doesn't own all stocks and he just own one stock twice.)
I wrote this SQL query below ~
<br />
SELECT DISTINCT dbo.Customers.CustomerName<br />
FROM dbo.CustomersStocks INNER JOIN<br />
dbo.Customers ON dbo.CustomersStocks.CustomerId = dbo.Customers.CustomerID<br />
WHERE STOCKid <br />
GROUP BY dbo.Customers.CustomerName, dbo.CustomersStocks.StockID, dbo.CustomersStocks.CustomerId<br />
HAVING (dbo.CustomersStocks.StockID =<br />
(SELECT COUNT(*) AS CountOfStock<br />
FROM dbo.Stocks))
It works okay.. but the customer who own a stock twice (e.g. "Michael" in my case) included in the result.. This is the problem..
So, How can I get the list of customers who own all stocks?
Thanks in advance.
|
|
|
|
|
You probably need to create a view of CustomersStocks that contains only a single entry for each customer instead of the multiple entries. Perhaps a select distinct might do it.
create or replace view uniquecustomersstocks as
select distinct customerid, stockid from customersstocks
;
|
|
|
|